comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » When is double not double? (converting from string to double)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
When is double not double? (converting from string to double) [message #88613] Sat, 17 May 2014 22:33 Go to next message
Tim B is currently offline  Tim B
Messages: 4
Registered: December 2009
Junior Member
I've remember reading about something like this somewhere before but could someone please explain this to me?

IDL> x = '133.359996'
IDL> print, double(x)
133.36000
Re: When is double not double? (converting from string to double) [message #88614 is a reply to message #88613] Sun, 18 May 2014 02:16 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 18.05.2014 07:33, Tim B wrote:
> I've remember reading about something like this somewhere before but could someone please explain this to me?
>
> IDL> x = '133.359996'
> IDL> print, double(x)
> 133.36000
>

https://www.idlcoyote.com/math_tips/sky_is_falling.html

The number x is just fine, the way you print it is not:

IDL> x = '133.359996'
IDL> print, double(x)
133.36000
IDL> print, STRING(double(x), FORMAT='(F10.6)')
133.359996

Cheers
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Coyote NCDF_FILE object to read HDF
Next Topic: hot pixels

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:32:01 PDT 2025

Total time taken to generate the page: 0.02290 seconds