Skip to content

Use GHC.Float functions rather than C code where possible #57

Description

@RyanGlScott

Currently, bytes defines functions to convert from floating-point values to word values (and vice versa) in i2d.c. However, in base-4.10.0.0 (GHC 8.2) and later, the GHC.Float module offers equivalent functionality in the castDoubleToWord64 function, as well as its cohorts. As far as I can tell, these functions are bit-for-bit compatible, although I'd have to stare at the corresponding Cmm code to know for sure.

If we used the GHC.Float functions instead, we would no longer need to link against C code on recent versions of GHC. This has come up elsewhere in ekmett/bits#7 (comment).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions