Changes between Initial Version and Version 1 of Ticket #3676


Ignore:
Timestamp:
Nov 20, 2009 10:01:42 PM (4 years ago)
Author:
igloo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3676 – Description

    initial v1  
    11As far as I can tell, the only way to convert between floating types in Haskell is to use realToFrac.  Unfortunately, this function does some insane mangling of values when converting.  Some examples: 
    2  
     2{{{ 
    33realToFrac (0/0 :: Double) :: Double 
    44  --> -Infinity 
     
    77realToFrac (-0 :: Double) :: CDouble 
    88  --> 0.0 
    9  
     9}}} 
    1010The last item illustrates an important point:  it is impossible to convert a value from Double to CDouble without potentially changing it.  This makes it difficult or impossible to use the FFI to call any functions with floating point parameters/return values. 
    1111