No safety in numbers

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun Sep 14 12:10:58 EDT 2003


Dnia czw 21. sierpnia 2003 22:30, Konrad Hinsen napisał:

> k_B = 0.0083144708636327096
>
> The trouble is that k_B then becomes "Double" by default (or any other
> type I declare it to be).

Declare it as
k_B :: Fractional a => a

Performance may suffer even in GHC if optimization is turned off.

BTW, Hugs incorrectly converts such numbers through Double which it 
represents as C float.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/



More information about the Haskell-Cafe mailing list