
8 Sep
2010
8 Sep
'10
8:04 a.m.
On Wed, Sep 08, 2010 at 12:58:48PM +0200, Lorenzo Isella wrote:
Dear All, I am quite new to Haskell and planning to see where it will lead me in scientific computing (I will be looking into hmatrix soon). Unless there are real memory problems, I would like to make sure that all real numbers are Double and all integer numbers are Integer types. Now, I understand that Haskell in most of the cases is smart enough to infer the type of a variable (integer, real, etc...), but can I also set its default precision once for all? I.e. if I say a=5.2 I want a to be used as a double precision real everywhere in the code.
Sure, just give a type signature: a :: Double a = 5.2 -Brent