Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-28 Thread Jules Bean
Josh Lee wrote: On Tue, 27 Nov 2007 14:41:59 -0500 Isaac Dupree <[EMAIL PROTECTED]> wrote: Henning Thielemann wrote: On Mon, 26 Nov 2007, Jason Dusek wrote: Among numeric types, it seems that only integer types are Bounded. Maybe because IEEE format supports Infinity? therefore, maxBound i

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Isaac Dupree
Among numeric types, it seems that only integer types are Bounded. Maybe because IEEE format supports Infinity? therefore, maxBound is Infinity and minBound negative infinity? But IEEE can be run with projective infinity in which case there is only one of them. Well, if Double becomes a pro

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Lennart Augustsson
But IEEE can be run with projective infinity in which case there is only one of them. On Nov 27, 2007 7:41 PM, Isaac Dupree <[EMAIL PROTECTED]> wrote: > Henning Thielemann wrote: > > On Mon, 26 Nov 2007, Jason Dusek wrote: > > > >> Among numeric types, it seems that only integer types are Bounded

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Henning Thielemann
On Tue, 27 Nov 2007, Yitzchak Gale wrote: > Bit Connor wrote: > > Also, a related question: How do you convert from Float -> Double, and > > the reverse? Only thing I could find is (fromRational . toRational) > > which I also imagine to be slow, and I also wonder about accuracy. > > realToFrac a

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Yitzchak Gale
Bit Connor wrote: > Also, a related question: How do you convert from Float -> Double, and > the reverse? Only thing I could find is (fromRational . toRational) > which I also imagine to be slow, and I also wonder about accuracy. realToFrac -Yitz ___ Ha

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Henning Thielemann
On Tue, 27 Nov 2007, Bit Connor wrote: > > Actually, IEEE numbers are designed in such a way, that if you interpret > > their bits as integer number, then 'succ' leads you to the next larger > > representable number. Thus you only have to cast from Float or Double to > > Int32 or Int64 respective

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Andrew Coppin
Josh Lee wrote: On Tue, 27 Nov 2007 14:41:59 -0500 Isaac Dupree <[EMAIL PROTECTED]> wrote: Henning Thielemann wrote: On Mon, 26 Nov 2007, Jason Dusek wrote: Among numeric types, it seems that only integer types are Bounded. Maybe because IEEE format supports Infinity

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Bit Connor
> Actually, IEEE numbers are designed in such a way, that if you interpret > their bits as integer number, then 'succ' leads you to the next larger > representable number. Thus you only have to cast from Float or Double to > Int32 or Int64 respectively, call enumFromTo, then cast back to Float or >

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Henning Thielemann
On Tue, 27 Nov 2007, Josh Lee wrote: > On Tue, 27 Nov 2007 14:41:59 -0500 > Isaac Dupree <[EMAIL PROTECTED]> wrote: > > > Henning Thielemann wrote: > > > On Mon, 26 Nov 2007, Jason Dusek wrote: > > > > > >> Among numeric types, it seems that only integer types are Bounded. > > > > > > Maybe becau

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Josh Lee
On Tue, 27 Nov 2007 14:41:59 -0500 Isaac Dupree <[EMAIL PROTECTED]> wrote: > Henning Thielemann wrote: > > On Mon, 26 Nov 2007, Jason Dusek wrote: > > > >> Among numeric types, it seems that only integer types are Bounded. > > > > Maybe because IEEE format supports Infinity? > > therefore, maxB

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Isaac Dupree
Henning Thielemann wrote: On Mon, 26 Nov 2007, Jason Dusek wrote: Among numeric types, it seems that only integer types are Bounded. Maybe because IEEE format supports Infinity? therefore, maxBound is Infinity and minBound negative infinity? Isaac __

Re: [Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-27 Thread Henning Thielemann
On Mon, 26 Nov 2007, Jason Dusek wrote: > Among numeric types, it seems that only integer types are Bounded. Maybe because IEEE format supports Infinity? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/has

[Haskell-cafe] Why aren't Float and Double Bounded?

2007-11-26 Thread Jason Dusek
Among numeric types, it seems that only integer types are Bounded. -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe