float equality

Walter Bright newshound2 at digitalmars.com
Sun Feb 20 20:32:40 PST 2011


Kevin Bealer wrote:
> == Quote from Walter Bright (newshound2 at digitalmars.com)'s article
>> Kevin Bealer wrote:
>>> You could switch to this:
>>>
>>> struct {
>>>     BigInt numerator;
>>>     BigInt denominator;
>>> };
>>>
>>> Bingo -- no compromise.
>> It cannot represent irrational numbers accurately.
> 
> True but I did mention this a few lines later.

I guess I'm not seeing the point of representing numbers as ratios. That works 
only if you stick to arithmetic. As soon as you do logs, trig functions, roots, 
pi, etc., you're back to square one.


More information about the Digitalmars-d mailing list