comp.lang.ada
 help / color / mirror / Atom feed
From: zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!firth@uunet .uu.net  (Robert Firth)
Subject: Re: Ada Readability, Book Reference
Date: 5 Jan 93 12:55:57 GMT	[thread overview]
Message-ID: <1993Jan5.075557.18978@sei.cmu.edu> (raw)

In article <1993Jan4.174424.5699@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael F
eldman) writes:

>This is interesting. I take it, then, that 1.0/3.0 will be flagged by
>the compiler, because - unless a rational representation is being
>used, which is always possible, I suppose - there aren't enough bits
>in a megabyte to evaluate it exactly. Do compilers use rationals
>for this?  I'll be back later, after a test or two of this!

Mike, in my experience most Ada compilers do indeed use rational
arithmetic to represent numbers and to evaluate universal
expressions.  Together, the lexis of numbers and the syntax of
arithmetic expressions guarantee that all constructible numbers
are rational (bet you never knew one of the designers was a
closet Pythagorean!).  The number "1.0/3.0" would therefore
be held internally as 1/3, until the time came to spit out the
right bits for the chosen target machine type.

I think a universal arithmetic package is available in the Simtel
archives.

             reply	other threads:[~1993-01-05 12:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-05 12:55 Robert Firth [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-01-05 16:50 Ada Readability, Book Reference agate!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.ed
1993-01-04 23:19 Tucker Taft
1993-01-04 17:44 Michael Feldman
1993-01-04  9:31 agate!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!nobeltech
1993-01-03 15:28 Orville R. Weyrich
1992-12-30  3:51 Michael Feldman
1992-12-29 19:35 Alex Blakemore
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox