home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!firth
- From: firth@sei.cmu.edu (Robert Firth)
- Subject: Re: Ada Readability, Book Reference
- Message-ID: <1993Jan5.075557.18978@sei.cmu.edu>
- Sender: netnews@sei.cmu.edu (Netnews)
- Organization: Software Engineering Institute
- References: <1992Dec30.035143.10291@seas.gwu.edu> <1993Jan4.093155.11894@nobeltech.se> <1993Jan4.174424.5699@seas.gwu.edu>
- Date: Tue, 5 Jan 1993 07:55:57 EST
- Lines: 19
-
- In article <1993Jan4.174424.5699@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) 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.
-