Bug 3999 and 4261

so so at so.do
Wed Sep 1 14:06:44 PDT 2010


> Float (short for "floating point"): The decimal point can "float" around  
> as
> the value changes (not a literal use of "float", but there's nothing  
> wrong
> with metaphoric uses of words, even in ordinary speech). This type is  
> named
> in contrast to the fixed-point arithmetic that was often used as an
> old-school optimization (where the decimal point was always at a fixed
> location, for example, the high 16-bits may have been the whole-number  
> part,
> and the low 16-bits may have been the decimal part).
>
> Double: This one's easy: It's double the size of a float.
>

If you throw "2.7f" on a water, does it float or you need to multiply with  
pi first?
Why don't we change double to hmm... doubleTheSizeOfFloat? Lets test it!

-
manifest doubleTheSizeOfFloat pi=3.14;
doubleTheSizeOfFloat f=2.7;
if(!floats(f))
   multiplyFirstOneWithTheSecondAndAssignToTheFirstParameter(f, pi); //  
that was the java operator overloading case? Yeh fundamental type but  
still it is funny!

-
enum pi=3.14;
double f=2.7;
if(!floats(f))
   f *= pi;

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list