division to move a decimal point [message #74068] |
Fri, 31 December 2010 09:13  |
Giuseppe Papa
Messages: 27 Registered: February 2010
|
Junior Member |
|
|
Hi,
I would like to convert the number 1948005 to 19480.05
The closest I can get is
print, 1948005*1./100.
which gives 19480.1
Any help would be appreciated!
Thanks,
Jeff
|
|
|
Re: division to move a decimal point [message #74198 is a reply to message #74068] |
Sun, 02 January 2011 18:09  |
M. Katz
Messages: 69 Registered: May 2005
|
Member |
|
|
Try double-precision, indicated by a 'd' rather than just a '.'
IDL> print, 1948005/100d
19480.050
When dividing this long integer by a double-precision floating-point
value, the calculation is performed in double-precision,
and you get a few more significant digits than with single-precision
floating-point, which was causing your rounding.
M.
|
|
|