[net.lang.ada] Real numbers with Janus/Ada

wpl@burdvax.UUCP (William Loftus) (01/07/85)

I seemed to recall that Janus/Ada besides lacking all the features
mentioned before, also lacks Float numbers (or real numbers).

I'm not sure of this can anyone confirm it?

I really don't know why Janus/Ada is even compared to Ada.  Comparing
it to an extended pascal (that has stronger type checking) would be better.

Janus/Ada is lacking all the features that make Ada different from other
block structured languages.  It is NOT Ada!

      /       
     /         /======/     Ronin  ..!burdvax!wpl
=======       /      /
/  /  /      /======/
======      /      /
 /         /======/
/

g-frank@gumby.UUCP (01/08/85)

> 
> I seemed to recall that Janus/Ada besides lacking all the features
> mentioned before, also lacks Float numbers (or real numbers).
> 
> I'm not sure of this can anyone confirm it?
> 

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 . . .

> I really don't know why Janus/Ada is even compared to Ada.  Comparing
> it to an extended pascal (that has stronger type checking) would be better.
> 
> Janus/Ada is lacking all the features that make Ada different from other
> block structured languages.  It is NOT Ada!
> 
>       /       
>      /         /======/     Ronin  ..!burdvax!wpl

I agree with you quite far on this point.  It is lacking generics, tasks,
and all sorts of interesting things.  On the other hand, it DOES have
exceptions, which I haven't noticed lately, even in non-standard Pascal
implementations.

A ronin is an out-of-work samurai.  Does this give a new meaning to the
term "hacking"?

-- 
      Dan Frank

	"good news is just life's way of keeping you off balance."

dgary@ecsvax.UUCP (D Gary Grady) (01/09/85)

<>
> 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

jans@mako.UUCP (Jan Steinman) (01/10/85)

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 ::::::