[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: address@hidden*Subject*: Re: Paul Graham's PyCon Keynote*From*: Paul Graham <address@hidden>*Date*: 11 Apr 2003 15:46:05 -0000*Cc*: address@hidden*Sender*: address@hidden

Two advantages of such non-binary representations of numbers are that (a) you get bignums automatically and (b) you can write + in the language. --Jakub Travnik wrote: > From: Michael Vanier <mvanier@cs.caltech.edu> > Subject: Re: Paul Graham's PyCon Keynote > Date: Thu, 10 Apr 2003 18:14:16 -0700 > > > > but conceptually, we can say: > > > data Integer = 0 | 1 | -1 | 2 | -2 | 3 | -3 | ... > > > > > > > Or: > > > > data Integer = Zero | Successor Integer | Predecessor Integer > > > > Both of solutions are very inefficient, but there are ways to define > numbers in other way, which leads to system that humans use. It is > almost as simple (depending on base), it does have finite number of > constructors and it is efficient for computing with big nubers too: > > data Integer = PositiveTerminator | NegativeTerminator | > Zero Integer | One Integer | Two Integer | > Three Integer | Four Integer | Five Integer | > Six Integer | Seven Integer | Eight Integer | > Nine Integer > > so we can get base 10 numbers. We need to choose direction (from most > significant to least, or reverse): > so we can write 1234 as > > One Two Three Four PositiveTerminator > or > Four Three Two One PositiveTerminator > depending on chosen direction. > > Arithmetic can be defined in same way as humans do, compute digit by > digit. > > > Jakub Travnik > jabber://jtra@jabber.com

- Prev by Date:
**Re: Paul Graham's PyCon Keynote** - Next by Date:
**Re: Paul Graham's PyCon Keynote** - Previous by thread:
**Re: Paul Graham's PyCon Keynote** - Next by thread:
**Re: Paul Graham's PyCon Keynote** - Index(es):