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

Home » Public Forums » archive » Re: IDL strplit : split a decimal number
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: IDL strplit : split a decimal number [message #40007 is a reply to message #40005] Wed, 07 July 2004 08:41 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
mwvogel wrote:
> Alternatively, you could use the format syntax
>
> IDL> PRINT, '['+STRSPLIT( STRING(DOUBLE(!pi), FORMAT='(D)'), '.',
> /EXTRACT)+']'
> [ 3] [1415927410125732]

But, last time I checked, pi was equal to 3.14159265358979323846...
try !dpi instead.

It is slightly confusing, however, that IDL

IDL> print,!dpi,format='(D50.40)'
3.1415926535897931159979634685441851615906

makes up some nonsense digits after reaching the machine precision
limit.

I guess I would have preferred a "simpler" output like
3.14159265358979300000000000000000000... when one can easily
spot that the double precision limit is reached at the 15th
digit.

Cheers,
Paolo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rebinning large array
Next Topic: Re: IDL strplit : split a decimal number -errata

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

Current Time: Fri Oct 10 14:56:09 PDT 2025

Total time taken to generate the page: 0.40207 seconds