<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Oh sorry, I misread the original question. I take it all back!<div><br></div><div>-Ross</div><div><br><div><div>On Sep 27, 2009, at 4:19 PM, Peter Verswyvelen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">He meant 16-bit floats, which have sizeOf 2<div><br></div><div>On GPUs this is common and implemented in hardware (at least on the old GPUs).</div><div><br></div><div>On DPSs you commonly had 24-bit floats too.</div><div><br>
</div><div>But these days I guess 32-bit is the minimum one would want to use? Most of the time I just use double anyway :)</div><div><br></div><div>On Sun, Sep 27, 2009 at 9:47 PM, Ross Mellgren <span dir="ltr">&lt;<a href="mailto:rmm-haskell@z.odi.ac">rmm-haskell@z.odi.ac</a>&gt;</span> wrote:</div>
<div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">What about the built-in Float type?<br>
<br>
Prelude Foreign.Storable&gt; sizeOf (undefined :: Float)<br>
4<br>
Prelude Foreign.Storable&gt; sizeOf (undefined :: Double)<br>
8<br>
<br>
Or maybe you mean something that can be used with FFI calls to C, in which case Foreign.C.Types (CFloat).<br>
<br>
Both instance the Floating, RealFloat, RealFrac, etc, classes so should operate largely the same as (modulo precision) a Double.<br>
<br>
-Ross<div><div></div><div class="h5"><br>
<br>
On Sep 27, 2009, at 2:42 PM, Olex P wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hi guys,<br>
<br>
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?<br>
<br>
Cheers,<br>
Oleksandr.<br></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div></div>
</blockquote></div><br></div></body></html>