[Haskell-cafe] 16 bit floating point data in Haskell?
Ross Mellgren
rmm-haskell at z.odi.ac
Sun Sep 27 16:38:33 EDT 2009
Oh sorry, I misread the original question. I take it all back!
-Ross
On Sep 27, 2009, at 4:19 PM, Peter Verswyvelen wrote:
> He meant 16-bit floats, which have sizeOf 2
>
> On GPUs this is common and implemented in hardware (at least on the
> old GPUs).
>
> On DPSs you commonly had 24-bit floats too.
>
> But these days I guess 32-bit is the minimum one would want to use?
> Most of the time I just use double anyway :)
>
> On Sun, Sep 27, 2009 at 9:47 PM, Ross Mellgren <rmm-
> haskell at z.odi.ac> wrote:
> What about the built-in Float type?
>
> Prelude Foreign.Storable> sizeOf (undefined :: Float)
> 4
> Prelude Foreign.Storable> sizeOf (undefined :: Double)
> 8
>
> Or maybe you mean something that can be used with FFI calls to C, in
> which case Foreign.C.Types (CFloat).
>
> Both instance the Floating, RealFloat, RealFrac, etc, classes so
> should operate largely the same as (modulo precision) a Double.
>
> -Ross
>
>
> On Sep 27, 2009, at 2:42 PM, Olex P wrote:
>
> Hi guys,
>
> Do we have anything like half precision floats in Haskell? Maybe in
> some non standard libraries? Or I have to use FFI + OpenEXR library
> to achieve this?
>
> Cheers,
> Oleksandr.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090927/b386a83b/attachment.html
More information about the Haskell-Cafe
mailing list