pro WCALCEPS, eps ;+ ;NAME: ; WCALCEPS ; ;PURPOSE: ; To compute the distance between 1.0 and the next ; largest floating point number. The output is the ; equivalent of Matlab's system "eps" variable. ; ;CATEGORY: ; Numerical Precision ; ;CALLING SEQUENCE: ; WCALCEPS, eps ; ;INPUTS: ; None. ; ;OUTPUTS: ; eps = the distance between 1.0 and the next ; largest single precision floating point number. ; ;NOTES: ; This eps value is useful for testing for round-off ; tolerance. Discussion of this variable is in: ; _Numerical Methods for Physicists_ by Alejandro ; Garcia, Prentice-Hall, 1994. ; ;MODIFICATION HISTORY: ; copyright (c) Amara Graps 1995, 1996. ;- eps = 1.0 ;change this to 1.0D0 if double prec. WHILE ( (1 + eps) GT 1) DO BEGIN eps = eps/2 END eps = 2*eps END