From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4a4e6b427ee75acf X-Google-Attributes: gid1164f8,public From: Keith Bierman QED Subject: Re: Precision on an Alpha Date: 1997/05/01 Message-ID: #1/1 X-Deja-AN: 238790257 Sender: khb@chiba References: <335FE9E7.41C6@latoso.cheme.cornell.edu> <33624533.30358528@mailbox.swipnet.se> Organization: SunSoft Newsgroups: comp.sys.dec Peter Sanger writes: ... > In Digital Unix subnormalized floating point numbers are trapped by the > operating system as a "floating invalid" operation. > Many platforms (used to) allow the use of these subnormalized floating > point values. Well, as such numbers are defined (and required) in the IEEE 754 standard it isn't surprising that some platforms support them ;> > This may explain why the program can be run on other > platforms without problems. Denormalized numbers can make hardware designers turn funny colors. It is not unusual for them to "punt" and graciously allow the system software to provide emulation logic. Often there are compilation/linkage/runtime switches that allow one to inform the system to use flush to zero semantics instead. > > Now the question is: why do I get a subnormalized floating point value, > if they are trapped by the OS? > On a platform that does not allow subnormalized floating point > values, Any platform that does not *allow* such values is not, in fact, an IEEE arithmetic compliant system. > floating point calculations will not result in a subnormalized number, > but cause a floating point underflow error or simply result in 0.0 . "flush to zero" semantics. It's not the only other option possible, but I can't recall another surviving approach. > The most likely explanation is that the program is buggy. Small > positive Subnormal/denormalized numbers have nothing to do with bugginess. It is the natural result of computing things close to zero. For a rationale behind the approach, the interested reader may wish to look up david goldberg's classic paper "what every computer scientist should know about floating point arithmetic". Note that in the absence of "inexact" (one of the IEEE "flags") denormalized computations don't result in a numeric loss (however when both underflow and inexact occur, there *has* been a loss). Other posters have amply noted the lack of direct connection between VAX and Alpha arithmetic. If you poke around with the debugger, you may be able to spot the computation where the trap occurs ... which may make the solution pretty obvious ;> In the alternative, the suggestions to promote your computations to wider precision may also do the trick. Good luck. -- Keith H. Bierman keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM SunSoft Developer Products | khb@netcom.com 2550 Garcia UMPK16-304 415 786-9296 | (415 7869296) fax Mountain View, CA 94043 Copyright 1997