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

Home » Public Forums » archive » division to move a decimal point
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
division to move a decimal point [message #74068] Fri, 31 December 2010 09:13 Go to next message
Giuseppe Papa is currently offline  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 Go to previous message
M. Katz is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: screen capture of xplot3d
Next Topic: Re: How to extract pixel values from a GeoTIFF using an Esri Shapefile

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

Current Time: Wed Oct 08 11:44:50 PDT 2025

Total time taken to generate the page: 0.00551 seconds