From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ef44357ebdfefea X-Google-Attributes: gid103376,public From: jpt@diphi.demon.co.uk (JP Thornley) Subject: Re: number bases Date: 1999/11/01 Message-ID: <860624474wnr@diphi.demon.co.uk>#1/1 X-Deja-AN: 543228854 X-Mail2News-Path: news.demon.net!finch-post-10.mail.demon.net!diphi.demon.co.uk References: <381D4C88.B5E8BBE7@interact.net.au> X-Trace: mail2news.demon.co.uk 941489460 mail2news:4506 mail2news mail2news.demon.co.uk Organization: None Reply-To: jpt@diphi.demon.co.uk Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1999-11-01T00:00:00+00:00 List-Id: In article: <381D4C88.B5E8BBE7@interact.net.au> G writes: > If someone decides to represent all or the majority of integers in a > program unit with base 2 > or > 16 > - does this in any way optimise the code. Which is to say - does it > take less space in memory and is it more efficient (does it run faster) > to represent integers (floats, whatever) in a form closer to the machine > architecture/structure (i.e. binary) ? > (This may not be relevant to the question, but...) I recently wrote an infinite (size and precision) Rational number package, where the radix used for the dividend and divisor could be anywhere between 2 and 45_000 (radix**2 has to be less than Max_Int). I tried it with a few different values, and the clear winner on speed was a radix of 256. (I don't know about storage). This was Gnat 3.10 on Win95. Cheers, Phil -- ------------------------------------------------------------------------ | JP Thornley EMail jpt@diphi.demon.co.uk | | phil.thornley@acm.org | ------------------------------------------------------------------------