From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=1.0 required=3.0 tests=BAYES_40,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 28 Jul 93 04:03:34 GMT From: waikato.ac.nz!canterbury.ac.nz!news!otago.ac.nz!simon@decwrl.dec.com (Th e Arch-Deviant) Subject: Re: ADA arithmetic Message-ID: <1993Jul28.170334.1@otago.ac.nz> List-Id: In article , gmacmanus@gandalf.otago .ac.nz (Greg MacManus) writes: > How do you implement the numbers then? > > - Just curious. Easy - treat them as variable-length arrays (ie in a record with a default discriminant) of 0..9 then treat each term as a coefficient in an polynomial evaluated at x=10. As Paul observes, the literature is bulging with nifty ways for performing operations on polynomials, and since we don't have to generate keys we can get away with defining only three operations - square the number, halve it and test for a remainder, and MOD. Simon Brady "I'd join the Movement, University of Otago If there was one I could believe in" Dunedin, New Zealand - U2, 'Acrobat'