Re: Why zero is represented by an extremely small value?
"www" <www@xxxxxxxxxx> wrote in message
news:f85gku$e1j$1@xxxxxxxxxxxxxxxxxxxxx
Hi,
I don't know a lot about Fortran. I noticed that when a variable value
is 0,
If the value is zero, it will print as zero.
if I print it out, it is a very small negative value, like
-7.6293945E-06.
It prints this value because the value of the variable is
actually -7.6293945E-06.
Is this normal in Fortran?
I noticed this when I was debugging a Java program which was translated
from Fortran one line by one line
<Fortran>
IF (TA .LT. 0.) THEN
..
</Fortran>
<Java>
if (TA <= 0.0) //It cannot be "<", must be "<=", otherwise the Java
results is different from Fortran results
...
</Java>
This is insufficient code on which to base any explanation.
.
Relevant Pages
- Re: Newbie question about double precision
... >>equal to zero. ... of Fortran do not allow it. ... (comp.lang.fortran) - Re: Finding roots of non-linear equations in Excel
... Where's the 'Numeric Recipes in BASIC' book? ... > it's no big deal to find the zero. ... > secant method could all be used (binary search is slowest but also ... Also, you are correct, the Numerical Recipes book is Fortran and C. ... (microsoft.public.excel.worksheet.functions) - Re: RfD: Ambiguity in FATAN2
... flag e.g. NEGATIVE-REAL-ZERO or similar. ... > for systems with and without negative zero. ... the Fortran document forbids having both ATAN2 ... I see Fortran doesn't specify the behavior of FATAN2 for NaN, ... (comp.lang.forth) - Re: Ideas for finding blank data fields in user records?
... trick all tested for negative zero using assembler and the SIGN ... The code itself says it was written in Fortran II. ... But if you are testing for a negative zero, there has to be a way to ... tape of the programs and several boxes of cards which turned out to be ... (comp.lang.fortran) - Re: Was there a negative real zero possibility in early Fortran?
... There is some possibility that negative fixed point zero ... I don't see anything in Fortran I ... Floating point negative zero is very common, ... (It is now standard, at least as of Fortran 2003, for machines ... (comp.lang.fortran) |
|