Thanks!
--
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
> >> How can I convert an Int into a Double?
> >
> > You don't convert to, you convert from :-)
> > The function 'fromIntegral' is probably what you want.
>
> And what function can I use to convert from Double to Int (the inverse of
> fromIntegral) ?
Use the functions in the RealFrac class.
http:
Dmitri,
And what function can I use to convert from Double to Int (the inverse
of
fromIntegral) ?
You should really have a look at the Prelude and the Standard Libraries.
Well, it depends on *how* you want to convert.
truncate :: (RealFrac a, Integral b) => a -> b
round :: (RealFrac a, Integral b)
How can I convert an Int into a Double?
You don't convert to, you convert from :-)
The function 'fromIntegral' is probably what you want.
And what function can I use to convert from Double to Int (the inverse of
fromIntegral) ?
TIA
Dmitri Pissarenko
--
Dmitri Pissarenko
Software Engineer
http://dap
Dmitri Pissarenko <[EMAIL PROTECTED]> writes:
> How can I convert an Int into a Double?
You don't convert to, you convert from :-)
The function 'fromIntegral' is probably what you want.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
___
Dmitri,
How can I convert an Int into a Double?
fromIntegral :: (Integral a, Num b) => a -> b
HTH,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Zitat von Henning Thielemann <[EMAIL PROTECTED]>:
On Wed, 26 Jan 2005, Dmitri Pissarenko wrote:
How can I convert an Int into a Double?
fromIntegral
Thanks!
--
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com
___
Haskell-Cafe mailing list
Haske
On Wed, 26 Jan 2005, Dmitri Pissarenko wrote:
> How can I convert an Int into a Double?
fromIntegral
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello!
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