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

Home » Public Forums » archive » Puzzle with floating point underflow
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Puzzle with floating point underflow [message #26334] Thu, 23 August 2001 00:30 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Hi all,


How can a float number be something e-42 if the system says it can only
represent numbers down to 1.e-38 in a float????????

test= 8.1047657d-42
IDL> tmp=float(test)
% Program caused arithmetic error: Floating underflow
% Detected at MGS_RGRID::REGRID 203 /pf/m/m218003/home/IDL/lib/mgs_newobjects
/mgs_rgrid__define.pro
IDL> help,tmp
TMP FLOAT = 8.10511e-42

IDL> help,machar(),/stru
** Structure MACHAR, 13 tags, length=52:
IBETA LONG 2
IT LONG 24
IRND LONG 5
NGRD LONG 0
MACHEP LONG -23
NEGEP LONG -24
IEXP LONG 8
MINEXP LONG -126
MAXEXP LONG 128
EPS FLOAT 1.19209e-07
EPSNEG FLOAT 5.96046e-08
XMIN FLOAT 1.17549e-38 <<<<<<<<<<<
XMAX FLOAT 3.40282e+38


(For those, who haven't figured this out from the Machar output: I am
running IDL5.3 on a Linux system (kernel 2.2.14))


Not a real problem because underflows are considered harmless, but I
am curious about this, anyhow.

Cheers,

Martin


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fortran + IDL
Next Topic: Reading a very large ascii data file

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

Current Time: Wed Oct 08 18:44:13 PDT 2025

Total time taken to generate the page: 0.37934 seconds