2.6) Dealing With Very Large And Small Numbers
You don’t want to be entering too many zeros so scientific notation is represented in the following way.
Number | Scientific notation in Fortran |
34567.34 | 3.456734E4 or 3.456734E+04 |
It is confusing since the E
represents x10 to the power and not the e
in math which is e = 2.7182818
.
So in a Fortran code, if you had a variable a
, you could set it equal to the number above by including a line as:
a=3.456734E4