Changes between Version 4 and Version 5 of Commentary/CmmExceptions


Ignore:
Timestamp:
Jan 8, 2007 9:17:09 PM (8 years ago)
Author:
p_tanski
Comment:

add reference to "realToFrac Issues", notes and link to TheCurrentGMPImplementation page

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/CmmExceptions

    v4 v5  
    1717There is at least one problem in GHC that requires FPU exception handling.  See bug ticket #1042.  The bug occurs in 'show'ing the number (conversion from base_2 to base_10).  Note that the FPU exception does not occur on PowerPC machines. 
    1818 
    19 [Note: placeholder until I can track down the original message --PT] 
    20  
    21 The following code will ''fail'' to produce a floating point exception or NaN on x86 machines (recall that 0.0/0.0 is NaN ''and'' a definite FPU exception): 
     19There was a long message thread on the Haskell-prime mailing list, "realToFrac Issues," beginning with [http://www.haskell.org/pipermail/haskell-prime/2006-February/000791.html John Meacham's message] and ending with [http://www.haskell.org/pipermail/haskell-prime/2006-March/000840.html Simon Marlow's message].  The following code for converting a Float to a Double will ''fail'' to produce a floating point exception or NaN on x86 machines (recall that 0.0/0.0 is NaN ''and'' a definite FPU exception): 
    2220 
    2321[in GHCi-6.6 on PowerPC, OS X]: 
     
    4240}}} 
    4341 
    44 This bug is not due to the lack of FPU exceptions in Cmm but bears mention as the internal conversion performed in 'realToFrac' on 'Float's and might benefit from FPU exceptions. 
     42This bug is not due to the lack of FPU exceptions in Cmm but bears mention as the internal conversion performed in 'realToFrac' on 'Float's would benefit from FPU exceptions: with Haskell-support for FPU exceptions this realToFrac would be able to issue an exception for NaN, Infinity or rounding errors when converting a Float to a Double and vice versa.  That there is a related problem with rounding errors in the functions 'encodeFloat', 'decodeFloat', 'encodeDouble' and 'decodeDouble', see [wiki:ReplacingGMPNotes/TheCurrentGMPImplementation].   
     43