#2281: properFraction implemented with modf primitive?
-------------------------+--------------------------------------------------
    Reporter:  guest     |       Owner:          
        Type:  proposal  |      Status:  new     
    Priority:  normal    |   Component:  Compiler
     Version:  6.8.2     |    Severity:  normal  
    Keywords:            |    Testcase:          
Architecture:  Multiple  |          Os:  Multiple
-------------------------+--------------------------------------------------
 I need a fast 'fraction' function for Double.
 I can use 'properFraction', but its Double instance uses 'decodeFloat',
 which is rather slow.
 It's also clumsy to use, because I have to provide an Integral type,
 although I'm not interested in the integral part.
 I can use (x - int2Double (double2Int x)) but this fails for x beyond the
 Int number range, and it is hard to fix that for an unknown implementation
 of Double.

 What about a 'modf' primitive which either calls 'modf' from standard C
 library
 or invokes an appropriate FPU command?
 If Double is in IEEE format the 'fraction' command could also be
 implemented quite efficiently by some bit masking without the FPU.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2281>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to