[Thread Prev][Thread Next][Index]

Re: [ferret_users] listing an integer number to a file



Hi Murat,

| I am trying to save an integer number to a file.
| 
| yes? let intnum = 200710120300
| yes? list/file=out.txt/nohead/clobber/format=(f20.0) intnum
| 
| 
| however, the out.txt file include below value, instead of intnum.
| more out.txt
|      200710127616.

I think a variable in Ferret is a single-precision floating point
number, which can accommodate only 5-7 decimal digits.  Your number
has 12 decimal places.  Even the standard integer (32-bit) can't
handle it.  (Its maximum is 2147483647.)

I don't have a good idea to solve your problem.  The best I can
think of right now is something along the lines of

  yes? let a = 1234
  yes? let b = 5678
  yes? list/format=(f5.0,f5.0) a,b
     . . . . . .
  1234.5678.

and remove the decimal points afterwards outside Ferret (using
a shell script or something).

Regards,
Ryo


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement