home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / ada / 3879 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.5 KB  |  31 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!firth
  3. From: firth@sei.cmu.edu (Robert Firth)
  4. Subject: Re: Ada Readability, Book Reference
  5. Message-ID: <1993Jan5.075557.18978@sei.cmu.edu>
  6. Sender: netnews@sei.cmu.edu (Netnews)
  7. Organization: Software Engineering Institute
  8. References: <1992Dec30.035143.10291@seas.gwu.edu> <1993Jan4.093155.11894@nobeltech.se> <1993Jan4.174424.5699@seas.gwu.edu>
  9. Date: Tue, 5 Jan 1993 07:55:57 EST
  10. Lines: 19
  11.  
  12. In article <1993Jan4.174424.5699@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
  13.  
  14. >This is interesting. I take it, then, that 1.0/3.0 will be flagged by
  15. >the compiler, because - unless a rational representation is being
  16. >used, which is always possible, I suppose - there aren't enough bits
  17. >in a megabyte to evaluate it exactly. Do compilers use rationals
  18. >for this?  I'll be back later, after a test or two of this!
  19.  
  20. Mike, in my experience most Ada compilers do indeed use rational
  21. arithmetic to represent numbers and to evaluate universal
  22. expressions.  Together, the lexis of numbers and the syntax of
  23. arithmetic expressions guarantee that all constructible numbers
  24. are rational (bet you never knew one of the designers was a
  25. closet Pythagorean!).  The number "1.0/3.0" would therefore
  26. be held internally as 1/3, until the time came to spit out the
  27. right bits for the chosen target machine type.
  28.  
  29. I think a universal arithmetic package is available in the Simtel
  30. archives.
  31.