commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] Math.pow usage was: Re: cvs commit: ...
Date Thu, 19 Jun 2003 19:12:59 GMT
J.Pietschmann wrote:

> Mark R. Diggory wrote:
>
>>>> J.Pietschmann wrote:
>>>>
>>>>> No. If you cast the base into a double there is not much risk of
>>>>> overflow: double x = n;  y=x*x; or y=((double)n)*((double)n);
>>>>> or even y=n*(double)n; (but avoid y=(double)n*n).
>>>>> Double mantissa has IIRC 52 bits, this should be good for integers
>>>>> up to 2^26=67108864 without loss of precision.
>>>>
>>
>> Is this correct, I've been reading (again, if I'm getting this 
>> correctly) the doubles mantissa is capable of supporting 15 -17 
>> decimal places, 2^26 is only 8.
>
>
> I meant: you can square integers up to 2^26 without loss of precision
> (due to truncation).
>
> J.Pietschmann 

Yes I do agree with you on that one.


-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message