Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Keith Bierman QED <keith.bierman@eng.sun.com>
Subject: Re: Precision on an Alpha
Date: 1997/05/01	[thread overview]
Message-ID: <tazn2qewsgt.fsf@eng.sun.com> (raw)
In-Reply-To: 33624533.30358528@mailbox.swipnet.se


Peter Sanger <peter.sanger@mailbox.swipnet.se> 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  <speaking for myself, not Sun*> Copyright 1997



  reply	other threads:[~1997-05-01  4:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-24  4:00 Precision on an Alpha Marcus A. Cuda
1997-04-24  4:00 ` Ron Natalie
1997-04-25  4:00   ` Phillip Helbig
1997-04-24  4:00 ` Jeffrey Potoff
1997-04-26  4:00   ` Peter Sanger
1997-05-01  4:00     ` Keith Bierman QED [this message]
1997-04-25  4:00 ` Carl Perkins
1997-04-25  4:00 ` Don Dossa
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox