At 10:58 AM 9/10/2001 -0700, David Whipp wrote:
>Dan Sugalski wrote:
> > Okay, I'm whipping together the "fancy math" section of the
> > interpreter assembly language. I've got:
>[...]
> > Can anyone think of things I've forgotten? It's been a while
> > since I've done numeric work.
>
>I'm not sure where this belongs, but I'd really like to have
>a usage model for some of the edges of arithmetic. For example,
>it should be possible to enable/disable overflow and underflow
>exceptions. Basically, Perl5 should be IEE754 compliant; and it
>should support the (optional) traps. It would also nice to have
>a saturation-on-overflow mode/type.

I'd intended the basic math ops on floats and ints (the ones in I and N 
registers) to ignore over and underflow stuff, or potentially throw 
exceptions, though there's no exception code at the moment. For math ops on 
variables, I'd intended they catch the exceptions and handle upgrading as 
appropriate. (The assumption being that the compiler would generate the 
low-level int/float code and make sure things don't over/underflow. I'm 
thinking that was probably a naive thought... :)

>If you have this type of stuff for floats; it'd be consistant to
>have it for integers, too.

Yep. For variable operations we'd need it certainly, to catch cases where 
we need to go to the bigint format.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to