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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
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 19:05:15 PDT 2025

Total time taken to generate the page: 0.20641 seconds