Data.Number.BigFloat/Fixed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
h.
Reply | Threaded
Open this post in threaded view
|

Data.Number.BigFloat/Fixed

h.
Hello,

With ghc-6.10.4 the following results are produced with numbers 2009.8.9:

(7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
False

(7e-3 :: BigFloat Prec50) < (8e-4 :: BigFloat Prec50)
True

where in the sourecode is written:
data BigFloat e = BF (Fixed e) Integer deriving (Eq, Ord)

and
import Data.Ratio
newtype Fixed e = F Rational deriving (Eq, Ord, Enum, Real, RealFrac)

H.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Data.Number.BigFloat/Fixed

Ivan Lazar Miljenovic
I'm sorry, but is there a question in there?

H. <[hidden email]> writes:

> (7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
> False
>
> (7e-3 :: BigFloat Prec50) < (8e-4 :: BigFloat Prec50)
> True
>
> where in the sourecode is written:
> data BigFloat e = BF (Fixed e) Integer deriving (Eq, Ord)
>
> and
> import Data.Ratio
> newtype Fixed e = F Rational deriving (Eq, Ord, Enum, Real, RealFrac)

--
Ivan Lazar Miljenovic
[hidden email]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Data.Number.BigFloat/Fixed

Brandon S Allbery KF8NH
On Mar 21, 2010, at 17:31 , Ivan Lazar Miljenovic wrote:
> I'm sorry, but is there a question in there?
> H. <[hidden email]> writes:
>> (7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
>> False

0.007 < 0.0006?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [hidden email]
system administrator [openafs,heimdal,too many hats] [hidden email]
electrical and computer engineering, carnegie mellon university    KF8NH



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

PGP.sig (202 bytes) Download Attachment
h.
Reply | Threaded
Open this post in threaded view
|

Re: Data.Number.BigFloat/Fixed

h.
In reply to this post by Ivan Lazar Miljenovic
Ivan Lazar Miljenovic <ivan.miljenovic <at> gmail.com> writes:

>
> I'm sorry, but is there a question in there?
>
> H. <h._h._h._ <at> hotmail.com> writes:
> > (7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
> > False
> >
> > (7e-3 :: BigFloat Prec50) < (8e-4 :: BigFloat Prec50)
> > True
>


7e-3 < 8e-4
The result should be False, but it's True.

Basically I don't know where to report this bug.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: Data.Number.BigFloat/Fixed

Antoine Latter-2
On Sun, Mar 21, 2010 at 4:49 PM, H. <[hidden email]> wrote:

> Ivan Lazar Miljenovic <ivan.miljenovic <at> gmail.com> writes:
>
>>
>> I'm sorry, but is there a question in there?
>>
>> H. <h._h._h._ <at> hotmail.com> writes:
>> > (7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
>> > False
>> >
>> > (7e-3 :: BigFloat Prec50) < (8e-4 :: BigFloat Prec50)
>> > True
>>
>
>
> 7e-3 < 8e-4
> The result should be False, but it's True.
>
> Basically I don't know where to report this bug.
>

Sending to the maintainer of the package, as listed on hackage.

Antoine
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
h.
Reply | Threaded
Open this post in threaded view
|

Re: Data.Number.BigFloat/Fixed

h.
Antoine Latter <aslatter <at> gmail.com> writes:

> On Sun, Mar 21, 2010 at 4:49 PM, H. <h._h._h._ <at> hotmail.com> wrote:
> >
> >
> > 7e-3 < 8e-4
> > The result should be False, but it's True.
> >
> > Basically I don't know where to report this bug.
> >
>
> Sending to the maintainer of the package, as listed on hackage.
>
> Antoine


This was my first idea as well, but there's no email:
http://hackage.haskell.org/package/numbers


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Data.Number.BigFloat/Fixed

Ivan Lazar Miljenovic
In reply to this post by Brandon S Allbery KF8NH
On 22 March 2010 08:33, Brandon S. Allbery KF8NH <[hidden email]> wrote:
> On Mar 21, 2010, at 17:31 , Ivan Lazar Miljenovic wrote:
>>
>> I'm sorry, but is there a question in there?
>> H. <[hidden email]> writes:
>>>
>>> (7e-3 :: BigFloat Prec50) < (6e-4 :: BigFloat Prec50)
>>> False
>
> 0.007 < 0.0006?

Oh, wait; that returns False which is correct, but 0.007 < 0.0008
returns True which is incorrect.  Which just goes to show I shouldn't
skim emails that early in the morning...

--
Ivan Lazar Miljenovic
[hidden email]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe