# Re: The spinoza papers: design of the extra-precision number object 2

On May 24, 11:41 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
spinoza1111<spinoza1...@xxxxxxxxx> writes:
On May 24, 1:24 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
<snip>
If you chose rational numbers as your representation (as many systems
do) all your operations would be closed.  Did you reject this more
common representation for a reason?

Not at all. I have an OO representation for which rational-fraction
algorithms can be written. It is {divide,a,b} where a and b are
"exact" reals.

OK.  Seems odd to do it that way since a and b are floating point
types.  Is there some advantage to this representation -- it looks
much harder to work with to me?

We only need monitor division for trouble. The first edition of the
code will therefore return a "symbolic", non-terminating value as an
expression when given division of a and b where a<b, etc.

How odd.  I think the exact rules are quite complex but a<b seem
rather crude.  You don't give the order, but 4/2 and 2/4 are both easy
to represent in you system and one of these has a<b.

The initial version will crudely refuse to divide when a<b.

And presumably in other cases as well.  You would represent 5/3
symbolically, no?  Personally, I'd allow 1/2 even right form the start
but getting all the cases where the result is exact will be quite a
challenge in the long run.

Hmm. The guiding philosophical principles of this effort shall be

(1) Implement algorithms without premature attention to efficiency,
while avoiding NP completeness as much as possible and repeated, non-
terminating operations. Of course, multiplication even of simple
integers by repeated additition and division even of simple integers
by repeated subtraction, IS NP complete.

(2) Don't put +/- indeterminacy in the first object model. It has been
placed in the Issues section of the design document as something
wonderful for later

(3) Complex numbers? We doan need no steenking...well, it is an Issue

(4) Try, really hard, not to reinvent Mathematica running 1e2 slower

(5) The point: to show that OO factoring works on something so simple
as a number

--
Ben.

.

## Relevant Pages

• Re: Hardware random generators and nondeterminsm
... Sahni "Fundamentals of Computer Algorithms." ... but what will that tell you about NP problems or NP completeness? ... machine will have to built and tested, or else the whole theory is ... The connection between the two meanings is that they are the same if ...
(comp.theory)
• Re: Aspiring highest-order programmer
... > long, very long, and not exactly focused on NP completeness). ... > more valuable to a working programmer than any formal definition. ... The use, then, I make of the theory is to rank algorithms according to ... the sort ordering relationship) I will code a quick "exchange" sort ...
(comp.programming)
• Re: Hardware random generators and nondeterminsm
... Sahni "Fundamentals of Computer Algorithms." ... but what will that tell you about NP problems or NP completeness? ... described is a process which produces a nondeterministic output. ... machine will have to built and tested, or else the whole theory is ...
(comp.theory)
• Re: Relevance of density of primes
... available for determining the primality of n directly. ... > Exact formulae for pido exist. ... > We have algorithms, based upon these formulae that will compute ... I'm not "looking for" anything, high-school level or otherwise, ...
(sci.math)
• Re: Verification of Rule based Expert System
... I'm looking for algorithms to do verification of an Rule Based Expert ... Systems (I mostly need Completeness and Consistency checks). ... [ask your news administrator to fix the problems with your system. ...
(comp.ai)