Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 4:26 PM +0100 8/24/04, Nicholas Clark wrote: On Tue, Aug 24, 2004 at 10:49:37AM -0400, Dan Sugalski wrote: As for rounding, I'm open to changes there too. Standard for computing is round-to-zero, since it's easy (drop the fractional part) but I was always taught round-to-closest-int. Too many

Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 11:29 AM -0400 8/24/04, Matt Fowles wrote: Dan~ I'm thinking now that multiplication of integers should upgrade to a float (which is large enough to hold the result with no loss of precision), division of integers should return a bignum (or a bigrat), and all float operations should produce

Re: Need some opinions on base behavior

2004-08-24 Thread Matt Fowles
Dan~ > I'm thinking now that multiplication of integers should upgrade to a > float (which is large enough to hold the result with no loss of > precision), division of integers should return a bignum (or a > bigrat), and all float operations should produce floats. The > destination PMC type can do

Re: Need some opinions on base behavior

2004-08-24 Thread Nicholas Clark
On Tue, Aug 24, 2004 at 10:49:37AM -0400, Dan Sugalski wrote: > As for rounding, I'm open to changes there too. Standard for > computing is round-to-zero, since it's easy (drop the fractional > part) but I was always taught round-to-closest-int. Too many physical > sciences classes, I expect. E

Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 11:05 AM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski <[EMAIL PROTECTED]> wrote: I'm up for some discussion on this one. I'm tempted to leave integer binary ops integers, I've already outlined that Python as well as Perl6 silently promote to BigInt. I'd rather have Integer as the common

Re: Need some opinions on base behavior

2004-08-24 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > I'm up for some discussion on this one. I'm tempted to leave integer > binary ops integers, I've already outlined that Python as well as Perl6 silently promote to BigInt. I'd rather have Integer as the common base type that implements most of these two la

Re: Need some opinions on base behavior

2004-08-24 Thread chromatic
On Mon, 2004-08-23 at 18:13, Dan Sugalski wrote: > The unary behavior of the types is reasonably straightforward. What > I'm puzzling over right now is the binary behavior. It's the edge > cases that are troublesome, of course -- what to do on overflow, and > what to do with fractional results.

Re: Need some opinions on base behavior

2004-08-23 Thread Matt Fowles
Dan~ I was originally going to say do them all or do the integer division/no overflow check option, but then something occurred to me. We already have I registers. If someone wants speed they should be using them anyway. If someone doesn't care about speed, but wants those semantics, their comp

Need some opinions on base behavior

2004-08-23 Thread Dan Sugalski
Leo's been nudging me to get the behaviours of the basic types defined, so I'm working on updating PDD 17 with them. The unary behavior of the types is reasonably straightforward. What I'm puzzling over right now is the binary behavior. It's the edge cases that are troublesome, of course -- wha