Re: error with "if" !!!



nakisa wrote:
Hi ,everybody
I have encounter with strange error ( strange in my point view !)
In program, I need to find the sample values of function named f . I
use these 3 commands :
1) if (f<0.0005D0 ) then
2) if (abs(f-0.0005D0)<0.001D0) then
3) if (abs(f-0.0005D0)<0.01D0 ) then

to see the answer . I was surprised to see the answer of this commands
are different !
for example , 7.3124E-5 only given by second if !!


I tried with 3 different compilers (g95, ifort and F) all gave the same answer: condition is true. Maybe you have to check the rest of your code.

Giorgio
.



Relevant Pages

  • error with "if" !!!
    ... I have encounter with strange error ... I was surprised to see the answer of this commands ...
    (comp.lang.fortran)
  • Re: error with "if" !!!
    ... I have encounter with strange error ... I was surprised to see the answer of this commands ... The answer is inherent in the nature of floating point representation ...
    (comp.lang.fortran)
  • Virtual Error
    ... I encounter a very strange error in virtual functions,I write a class A, ... inherited from A,B:pulic A, which has another virtual function, then I write ... Prev by Date: ...
    (microsoft.public.vc.language)
  • [newbie] strange error
    ... I'm currently developing a VB.NET application and I encounter a strange error: ... Private Sub LinkLabel5_LinkClicked(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.general)