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

Home » Public Forums » archive » IDL strplit : split a decimal number
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
IDL strplit : split a decimal number [message #40016] Wed, 07 July 2004 02:53
bruno.galand is currently offline  bruno.galand
Messages: 1
Registered: July 2004
Junior Member
Hi,

I'm a new IDL user and I have problems using the function STRSPLIT.
Actually, I need to split a float number to seperate the FLOOR part
from the decimal one.
For example, let's take A = 147.123456789d
I need to make an 2D integer array called B, containing the two parts
of A seperated by the dot ... B(0) = 147 and B(1) = 123456789 ... with
all this accuracy.
But writing such thing as:
B = strsplit(a, '.', /extr)
is not accurate enough, since it only returns:
B(0) = 147 and B(1) = 12346
I thought it was only the 'print' function which returns an
approximation of B(1), but if I write B(1)-12346, it returns 0 ... and
if I try B(1)-123456789, it returns -123444443

Can any one help me with this?
Maybe I shouldn't use the STRSPLIT function to do this?
Maybe I don't use this function correctly ...
Thank you for all remarks.
Bruno
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Background Color in Postscript
Next Topic: Rebinning large array

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

Current Time: Wed Oct 08 19:04:51 PDT 2025

Total time taken to generate the page: 0.00462 seconds