develooper Front page | perl.perl6.language | Postings from September 2001

RE: Math functions? (Particularly transcendental ones)

Thread Previous | Thread Next
From:
Hong Zhang
Date:
September 10, 2001 14:13
Subject:
RE: Math functions? (Particularly transcendental ones)
Message ID:
400CE9390E334A4393CEECDD6863120A28A04B@ussccm003.corp.palm.com
> Uri Guttman  
> > we are planning automatic over/underflow to bigfloat. so there is no
> > need for traps. they could be provided at the time of the 
> > conversion to big*.
> 
> OK. But will Perl support signaling and non-signaling NANs?

I don't think we should go for automatic overflow/underflow between
float and bigfloat. The float exception (overflow, underflow, inexact,
divide zero, ...) is very difficult to handle. Using Unix signal is 
expensive and very platform-specific (lots of ucontext issues). Since
C language does not support floating-point signal, we may use some
assembly code to handle it, it will be porting nightmare.

Since most of floating-point assumes IEEE-semantics, taking automatic
float/bigfloat will change this assumption significantly. It may a
lot of code and algorithm. I think it is safer just to provide a
BigDecimal class for developers to use, and keep the basic float
semantics (close to 64-bit IEEE-754 if possible).

Hong

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About