[clean-list] IEEE floating point and Clean

Marco Kesseler M.Kesseler@aia.nl
Wed, 12 Sep 2001 16:14:16 +0200


RT Happe wrote: 
> On Wed, 12 Sep 2001, Marco Kesseler wrote:
> > It IS possible to create your own floating point numbers in Clean,
> > an attach flags to them. Various operations on these numbers
> > should then test their results for 'INF' and the like, and set the
> > flags. Users of these numbers can then check whether something
> > went wrong in the computation of some result.
> 
> However, it would be quite awkward to make your software emulate what
> the arithmetic processor already does for you.

That's true. Still, it is possible. As to direct support, note that 
Clean is not an imperative language, so if you want to have direct 
access to the floating point processor flags either:
- the flags have to be unique, and passed explicitly
- Clean has to associate the flag with each floating point value 
(setting and getting it from the processor when necessary) and 
optimise away the setting/getting in a sequence of floating point 
operations.
- some other solution?

Otherwise you never now which computation the processor flag 
pertains to. Thinking of this: do these flags ordinarily get saved for 
each thread when a context switch arrives? I guess they should.

regards,
Marco Kesseler

----------------------------------------------------------------------
Aia                                     Phone: +31 24 371 02 30
PO Box 38025                            Fax:   +31 24 371 02 31
6503 AA Nijmegen                        Email: M.Kesseler@aia.nl
The Netherlands                         URL:   http://www.aia.nl
----------------------------------------------------------------------
This E-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are adressed. If you have received this E-mail in error please notify
the postmaster (postmaster@aia.nl). The authenticity of this
message cannot, at this moment, be guaranteed by ourselves. For this
reason no legal rights may be granted should the contents differ to
the original sent message. The Aia log-file of sent messages is 
deemed to be the sole, true transcript of communication unless the 
contrary, other than the received message, can be proven.
----------------------------------------------------------------------