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

Home » Public Forums » archive » the precision of PRINT and HELP statements
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
the precision of PRINT and HELP statements [message #26930] Thu, 04 October 2001 09:46 Go to next message
george.mccabe is currently offline  george.mccabe
Messages: 10
Registered: October 2001
Junior Member
hello,

this one made me laugh when i realized what was going on -

IDL> help, chkN
CHKN LONG = 140486
IDL> help, float(Nhb)/Nreq0
<Expression> FLOAT = 140486.
IDL> print, chkN - float(Nhb)/Nreq0
-0.500000


perhaps one should expect IDL's PRINT statement to act this way,

IDL> print, float(Nhb)/Nreq0
140486.
IDL> print, format='(g)', float(Nhb)/Nreq0
140486.5

but, the HELP command i feel should show the actual value to the
precision of the variable type.

is there a way to set the format of HELP output, or adjust system wide
format settings?

thank you,
george, george.mccabe@gsfc.nasa.gov
Re: the precision of PRINT and HELP statements [message #27064 is a reply to message #26930] Thu, 04 October 2001 23:29 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
George McCabe wrote:
>
> hello,
>
> this one made me laugh when i realized what was going on -
>
> IDL> help, chkN
> CHKN LONG = 140486
> IDL> help, float(Nhb)/Nreq0
> <Expression> FLOAT = 140486.
> IDL> print, chkN - float(Nhb)/Nreq0
> -0.500000
>
> perhaps one should expect IDL's PRINT statement to act this way,
>
> IDL> print, float(Nhb)/Nreq0
> 140486.
> IDL> print, format='(g)', float(Nhb)/Nreq0
> 140486.5
>
> but, the HELP command i feel should show the actual value to the
> precision of the variable type.
>
> is there a way to set the format of HELP output, or adjust system wide
> format settings?
>
> thank you,
> george, george.mccabe@gsfc.nasa.gov


Dear George,

we have some routines which returns the format code of a value


http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/find_form.tar.gz

; EXAMPLE:
; numbers=[100,2.1345,1000.]
; print,find_form(numbers)
; F10.4
; print,find_form(numbers,/reduce_accuracy)
; F10.2
; print,find_form(-40010138.D)
; I9
; print,find_form(-40010138.D,/force)
; F10.0

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/number_format.tar.gz


For further routines and licensing please have a look at
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml


regards
Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======

read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Polygon filling oddities
Next Topic: Using MIN on arrays : Exorcising loops?

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

Current Time: Wed Oct 08 13:57:21 PDT 2025

Total time taken to generate the page: 0.00552 seconds