Re: fix(4.70*100) is... 469 [message #53565 is a reply to message #53563] |
Wed, 18 April 2007 22:56   |
mmeron
Messages: 44 Registered: October 2003
|
Member |
|
|
In article <f06eqm$412$1@news.ucalgary.ca>, "Jean H." <jghasban@DELTHIS.ucalgary.ANDTHIS.ca> writes:
>>> .... so how can it be the float accuracy problem if the difference
>>> between the expected and the real value is 256 times bigger than the
>>> float error?
>>>
>> Careful here. The smallest float provides relative accuracy, meaning
>> the difference between exact and stored value X doesn't exceed
>> X*(machar()).eps. This is well satisfied here.
>>
>> Mati Meron | "When you argue with a fool,
>> meron@cars.uchicago.edu | chances are he is doing just the same"
>
> I don't understand why one should multiply epsilon by X .... why would
> the acceptable difference between expect and real value be a function of
> the value? ... X = 100.0 Y = 900.0 .... they both have the same number
> of significant digits, so why would the max acceptable difference be
> IDL> print, 100.0 * epsilon
> 1.19209e-005
> IDL> print, 900.0 * epsilon
> 0.000107288
>
>
> Also, if one must really multiply epsilon by X, does it mean that there
> is an error on http://www.dfanning.com/math_tips/razoredge.html, at the
> last line of the page?
>
> IDL> print,abs(0.9 - (0.6+0.3)) lt (machar()).eps
>
> should it be
> IDL> print,abs(0.9 - (0.6+0.3)) lt 0.9 * (machar()).eps
>
> ???
>
> I admit to be lost on this issue... and it scares me as I might have to
> check/change all my codes!!!!!
>
> Do you have a reference at hand on this?
>
Consider what "same number of significant digits mean. For example,
consider that 1.23456*10^20 and 1.23456*10^(-20) have same number of
significant digits.
Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
|
|
|