🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #22778

Re: floating point formats -- usage of small floats

#22778
From: Jeff Kenton
Date: Mon, 05 Mar 1990 11:20
30 lines
1843 bytes
From article <1990Mar5.031003.12107@Neon.Stanford.EDU>, by wilson@carcoar.Stanford.EDU (Paul Wilson):
> I'm looking for info that would be useful in implementing short
> floating point numbers for Lisp/Smalltalk/etc.
> 
> The basic idea is that I want short (1-word) floating point numbers to
> fit in one 32-bit words, *with* a runtime tag included.  My plan is
> . . .
> 
> Of course, this means I have to sacrifice a few bits of a standard 32-bit
> float to make it fit.
> 

Standard 32-bit floats have 1 sign bit, 8 exponent bits and 23 (+1) bits of
mantissa.  This gives an exponent range of 10**-38 to 10**+38, and a
precision of about 7 decimal digits.

For each bit of exponent you drop you cut the range in half -- 4 bit exponents
only leave a range of .004 to 511.  Each four bits of mantissa you drop will
lose you slightly more than 1 decimal digit.

Furthermore, anything you do will mean that the FP hardware won't work with
your number format.  And, no, you couldn't fake it, truncate it or trick it
to get "approximately right" results from a chain of calculations "most of
the time".  Your users would shoot you.



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      jeff kenton  ---	temporarily at jkenton@pinocchio.encore.com	 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Technical Details
Message-ID: <11298@encore.Encore.COM>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!bu.edu!husc6!encore!pinocchio.encore.com
References: <1990Mar5.031003.12107@Neon.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!bu.edu!husc6!encore!pinocchio.encore.com
From: jkenton@pinocchio.encore.com (Jeff Kenton)
Newsgroups: comp.arch
Subject: Re: floating point formats -- usage of small floats
Message-ID: <11298@encore.Encore.COM>
Date: 5 Mar 90 11:20:13 GMT
References: <1990Mar5.031003.12107@Neon.Stanford.EDU>
Sender: news@Encore.COM
Lines: 30