[Haskell-cafe] Converting from Int to Double

Dmitri Pissarenko mailing-lists at dapissarenko.com
Wed Jan 26 07:48:17 EST 2005


I have a list of integer numbers (grayscale values from 0 to 255) and want to
convert them to a list of double numbers, so that each number is 0 <= x <= 1,
where 0 is completely black and 1 is completely white.

Before I convert the numbers, I need to convert them to a list of double
values (then I can use map to re-scale each element from 0..255 to 0..1).

How can I convert an Int into a Double?


Dmitri Pissarenko
Dmitri Pissarenko
Software Engineer

More information about the Haskell-Cafe mailing list