* Re: Real numbers with Janus/Ada
1985-01-08 5:49 ` g-frank
@ 1985-01-09 15:33 ` D Gary Grady
1985-01-09 23:38 ` Jan Steinman
1 sibling, 0 replies; 4+ messages in thread
From: D Gary Grady @ 1985-01-09 15:33 UTC (permalink / raw)
<>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Real numbers with Janus/Ada
1985-01-08 5:49 ` g-frank
1985-01-09 15:33 ` D Gary Grady
@ 1985-01-09 23:38 ` Jan Steinman
1 sibling, 0 replies; 4+ messages in thread
From: Jan Steinman @ 1985-01-09 23:38 UTC (permalink / raw)
In article <245@gumby.UUCP> g-frank@gumby.UUCP writes, quotes:
>> I seemed to recall that Janus/Ada besides lacking all the features
>> mentioned before, also lacks Float numbers (or real numbers).
>
>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.
There seems to be some confusion here. A real number can be either a
"fixed point type" or "floating point type", both of which are subtypes of
the anonymous predefined type "universal_real". (LRM language is in double
quotes) The mentioned 'based real numbers' sounds like the method used in Ada
to specify real literals in arbitrary radix, something few languages offer.
(When was the last time you needed a number like 16#-F.EDCBA987654#E32?) I
would assume that Janus/Ada supports floating point operations in ordinary
base 10 representations.
>... The term doesn't appear in Gehani....
Don't mess with popular books for questions like this. GPO will send you
ANSI/MIL-STD-1815A ("Language Reference Manual", or commonly, LRM") for a mere
$8.00. It's not light reading, but is precise, concise, and makes K&R look
like "Dick and Jane" in its completeness. The only other I'd recommend is
"Software Engineering With Ada", Grady Booch.
References: LRM 2.4.2-5, 3.5.6-5, 3.5.7-4
--
:::::: Jan Steinman Box 1000, MS 61-161 (w)503/685-2843 ::::::
:::::: tektronix!tekecs!jans Wilsonville, OR 97070 (h)503/657-7703 ::::::
^ permalink raw reply [flat|nested] 4+ messages in thread