type comparisons

Denton Cockburn diboss at hotmail.com
Sat Jan 26 10:45:40 PST 2008


On Sat, 26 Jan 2008 18:36:41 +0000, BCS wrote:

> Reply to Denton,
> 
>> [quoted text muted]
> 
> rounding error?
> 
> rounding 0.6584 (base 10) to real and then converting to double may round 
> different than rounding it directly to double.

I can't think of a reason that would be acceptable.
This means I can't reliably do operations with converted reals/doubles :(

This is also weird:
double a = 0.65;
real b = a + 0.1;
b -= 0.1;
assert(b == a); // fails

real c = a;
c += 0.1;
c -= 0.1;
assert(c == a); // passes


More information about the Digitalmars-d-learn mailing list