Arithmetic error from NR_MACHAR() [message #12177] |
Mon, 29 June 1998 00:00  |
Heiko H�nnefeld
Messages: 7 Registered: June 1998
|
Junior Member |
|
|
Hi all,
I tried to find out the machine precision on my LINUX PC with IDL 5.0.
The result is the following:
IDL> help, /struc, NR_MACHAR(/DOUBLE)
** Structure DMACHAR, 13 tags, length=68:
IBETA LONG 2
IT LONG 64
IRND LONG 2
NGRD LONG 0
MACHEP LONG -63
NEGEP LONG -64
IEXP LONG 2
MINEXP LONG -1075
MAXEXP LONG -1073
EPS DOUBLE 1.0842022e-19
EPSNEG DOUBLE 5.4210109e-20
XMIN DOUBLE 0.0000000
XMAX DOUBLE Inf
% Program caused arithmetic error: Floating divide by 0
It seems, that MAXEXP has got the wrong value.
Also XMAX, which is according to the manual calculated as
(1-EPSNEG)*IBETA^MAXEXP, is Infinity, what may be the origin of the
error message.
But then I tried this:
IDL> prec = NR_MACHAR(/DOUBLE)
% Program caused arithmetic error: Floating divide by 0
IDL> print, (1-prec.EPSNEG)*prec.IBETA^prec.MAXEXP
0.0000000
There I dont get 'Infinity' as result, but '0.0'.
If, however, I try the same on a UNIX-system, first everything seems ok.
IDL> help, /struc, NR_MACHAR(/DOUBLE)
** Structure DMACHAR, 13 tags, length=72:
IBETA LONG 2
IT LONG 53
IRND LONG 2
NGRD LONG 0
MACHEP LONG -52
NEGEP LONG -53
IEXP LONG 11
MINEXP LONG -1022
MAXEXP LONG 1024
EPS DOUBLE 2.2204460e-16
EPSNEG DOUBLE 1.1102230e-16
XMIN DOUBLE 2.2250739e-308
XMAX DOUBLE 1.7976931e+308
But - if I calculate XMAX myself again - the result is 0.0:
IDL> prec = NR_MACHAR(/DOUBLE)
IDL> print, (1-prec.EPSNEG)*prec.IBETA^prec.MAXEXP
0.0000000
If I use MACHAR() instead of NR_MACHAR(), exactly the same happens.
The keyword DOUBLE also is not the origin of the problem.
Maybe anybody else understands, what happens?
Thanks,
Heiko
--
Heiko H�nnefeld
HASYLAB / DESY
Notkestr. 85
22603 Hamburg
Tel.: 040 / 8998-2698
Fax.: 040 / 8998-2787
e-mail: hhuenne@desy.de
|
|
|