[Haskell-beginners] convert to fixed length Int

Christopher Howard christopher.howard at frigidcode.com
Fri Aug 17 02:42:08 CEST 2012


Hi. In Haskell, how would I go about converting from a Double (or Float)
type to a Data.Int.Int8, Data.Int.Int16, and so forth? (Of course,
expecting rounding and damage to out of range values.)

I was playing around with signal generation using trig functions (hence
the floating types) but the actual output has to be Int16.

-- 
frigidcode.com
indicium.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120816/10ff76fd/attachment.pgp>


More information about the Beginners mailing list