comp.lang.ada
 help / color / mirror / Atom feed
From: dgary@ecsvax.UUCP (D Gary Grady)
Subject: Re: Real numbers with Janus/Ada
Date: Wed, 9-Jan-85 10:33:10 EST	[thread overview]
Date: Wed Jan  9 10:33:10 1985
Message-ID: <480@ecsvax.UUCP> (raw)
In-Reply-To: 245@gumby.UUCP

<>
> From g-frank@gumby.UUCP Wed Dec 31 19:00:00 1969
> According to their literature, Janus/Ada lacks "based real numbers."
> What the heck is that?  The term doesn't appear in Gehani.  I do think
> the language handles floats.  Funny waste of in line 8087 code . . .

A "based" number in Ada is a constant written in other than base 10.
The syntax is

based_number ::=
	base # based_integer [.based_integer] # [exponent]

base ::= integer

based_integer ::= extended_digit {[underscore] extended_digit}

extended_digit ::= digit | letter

where base is limited to 2 through 16 and extended digits to 0 through
F.  For example, the integer 255 can be written as any of the following:

16#FF#  16#FF#E0  2#1111_1111#  10#255#

and so on.  A based real number contains a decimal point.  4095.0 can be
written

16#F.FF#E2  2#1.1111_1111_111#E11

and so on.  Note that the exponent is in the appropriate base.  In
defense of Janus/Ada's omission of based reals, I don't think they're
likely to come up that often.  Based integers, however, are very nice.

The "official" definition of Ada is, I believe, MIL-STD-1815 and can be
ordered from the Superintendent of Documents, US Government Printing
Office, Washington, DC  20402.  I'm not sure of the current price, but I
think it's fairly cheap.

Best,

-- 
D Gary Grady
Duke U Comp Center, Durham, NC  27706
(919) 684-4146
USENET:  {seismo,decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary

  reply	other threads:[~1985-01-09 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1985-01-06 23:39 Real numbers with Janus/Ada William Loftus
1985-01-08  5:49 ` g-frank
1985-01-09 15:33   ` D Gary Grady [this message]
1985-01-09 23:38   ` Jan Steinman
replies disabled

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