IDL strplit : split a decimal number [message #40016] |
Wed, 07 July 2004 02:53 |
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
|
|
|