[Fwd: RE: 0.85 asRational = (85/100) ?]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Fwd: RE: 0.85 asRational = (85/100) ?]

Andres Valloud-3
Steven,

Revising the comments is a good idea.  I am forwarding myself this email
to keep track of your suggestion.

Thanks,
Andres.

-------- Original Message --------
Subject: RE: 0.85 asRational = (85/100) ?
Resent-Date: 28 Aug 2007 07:56:40 -0000
Resent-From: [hidden email]
Resent-CC: recipient list not shown: ;
Date: Tue, 28 Aug 2007 11:05:41 +0300
From: Steven Kelly <[hidden email]>
To: <[hidden email]>



Andres Valloud wrote:

> > Jens Meisner wrote:
> >> VW7.4:
> >> 0.85 asRational  = (848850/998647) >> true
> >> 0.85 asRational = (85/100) >> false
> >>
> >> That´s ugly isn´t it ?
> >> Is this bug fixed?
>
> This kept bugging me.  0.85 asRational should not be expected to be
> 85/100.  However, what is left unexplained is how a rational
> representation of a floating point number can have an odd denominator

I was just about to ask the same!

Jens might prefer to use 0.85s:
  0.85s asRational = (85/100) >> true
The comments in FixedPoint should be read to understand the details.

It might be useful to update the comments in LimitedPrecisionReal classes to reflect the most often asked questions.

Cheers,
Steve