I know Haskell has native data types which allow you to have really big integers so things like
>> let x = 131242358045284502395482305
>> x
1312
Haskell does not have high-precision floating-point numbers naitively.
For a package/module/library for this purpose, I'd refer to this answer to another post. There's also an example which shows how to use this package, called numbers.
If you need a high precision /fast/ floating point calculations, you may need to use FFI and long doubles, as the native Haskell type is not implemented yet (see https://ghc.haskell.org/trac/ghc/ticket/3353).
Depending on exactly what you are looking for:
Float
and Double
- pretty much what you know and "love" from Floats and Doubles in all other languages.Ratio
of Integer
sFixedPoint6464
. If you want a number that is 1024 integral bits and 8 fractional bits then use $(mkFixedPoint 1024 8)
to generate type FixedPoint1024_8
.numbers
package mentioned above - very cool.