On Tue, Feb 26, 2002 at 10:57:45AM +0000, David Chan was heard to mutter: > On Fri, Feb 22, 2002 at 03:08:58AM +0000, Alex Gough wrote: > > =item Division > > > > Under integer conditions, division is halted once the first fractional > > digit is calculated, with the result then being rounded to an integer > > and returned. ^^^^^^^^^^^^^^^^^^^^^ > > Would it be good to say exactly what type of rounding this is? What > is 19 / 5? How about 19 / -5? FWIW, here's what Perl currently thinks:
Whatever rounding is in place, so 19 / 5 -> 3, 4/5 -> 3.8 so rounds up to 4. If people want integer division, ie. divide that halts at the decimal point, they should use divide_integer. The signs of the operands are treated just as you'd expect, this is mathematics after all. > > =head2 Big number representation > > > > INTVAL expn; /* exponent of number */ > ^^^^^^ > > This a normal Parrot integer, right? If so, does it mean our exponents > cannot be bigger than MAXINT? If so, do we care? (I looked at the URL > you gave, and noticed that their arbitrary precision library has an > exponent size limit). Yes, at some point allowing 10**222222222222222222222, is just silly, and I doubt the potentional applications are numerous enough to warrant trying it. So long as we're clear about what the limits are, and raise exceptions if a) they're breached, and b) people ask for them, then everything will end up being ok. Alex Gough -- Today class, we'll be cloning extinct species to see how they taste.