On Thu, 4 Nov 2004 21:46:19 -0800, Jeff Clites <[EMAIL PROTECTED]> wrote: > On Nov 4, 2004, at 8:29 PM, Brent 'Dax' Royal-Gordon wrote: > > This is true. But how do you define a number? Do you include > > floating-point? Fixed-point? Bignum? Bigrat? Complex? Surreal? > > Matrix? N registers don't even begin to encompass all the "numbers" > > out there. > > Floating point, and possibly integer. Those are the numeric primitives > of processors. Other aggregate mathematical types are always defined in > terms of those (in a computing context), one way or another.
Yes, but your decomposition (N2=P2; N3=P3; N1=N2+N3; P1=N1) doesn't take anything but the primitives into account. It would destroy the meaningfulness of performing a pow() on a complex number, or even just a bignum (which the language isn't necessarily even aware will be involved in a particular operation--many will convert smoothly between integer and bignum). Dynamic languages generally try to hide the reality of the machines they run on from the programmer; things like "pow only works on numeric primitives" smack the programmer in the face with that reality. (Sure, languages can work around it, but their various hacks will probably be mutually incompatible and less efficient than just doing it ourselves.) Operations that only work with primitives makes sense for hardware, but out here in the realm of software we can do better. -- Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker There is no cabal.