* How to calculate negative binary??
@ 1997-03-31 0:00 Centaury
1997-03-31 0:00 ` Mark A Biggar
1997-04-03 0:00 ` Tucker Taft
0 siblings, 2 replies; 3+ messages in thread
From: Centaury @ 1997-03-31 0:00 UTC (permalink / raw)
Compilation error occurs when I entered the line :
p:=2# - 1010110 #
and is caused by the negative value of the binary. How to correct it?
--
Please mail replies to :
utopian@pl.jaring.my
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to calculate negative binary??
1997-03-31 0:00 How to calculate negative binary?? Centaury
@ 1997-03-31 0:00 ` Mark A Biggar
1997-04-03 0:00 ` Tucker Taft
1 sibling, 0 replies; 3+ messages in thread
From: Mark A Biggar @ 1997-03-31 0:00 UTC (permalink / raw)
In article <01bc3bf9$a8a655e0$d87d8ea1@AaBbCcDd> "Centaury" <utopian@pl.jaring.my> writes:
>Compilation error occurs when I entered the line :
>p:=2# - 1010110 #
>and is caused by the negative value of the binary. How to correct it?
There is no such thing as a negative literal number in Ada, there is just
the negation operator applied to a positive literal. This usualy makes
no difference as all compilers do the evaluation of the negation operator in
such a case at compile time, so what you want to write is:
p := -2#1010110#;
--
Mark Biggar
mab@wdl.lmco.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to calculate negative binary??
1997-03-31 0:00 How to calculate negative binary?? Centaury
1997-03-31 0:00 ` Mark A Biggar
@ 1997-04-03 0:00 ` Tucker Taft
1 sibling, 0 replies; 3+ messages in thread
From: Tucker Taft @ 1997-04-03 0:00 UTC (permalink / raw)
Centaury (utopian@pl.jaring.my) wrote:
: Compilation error occurs when I entered the line :
: p:=2# - 1010110 #
: and is caused by the negative value of the binary. How to correct it?
p := -2#1010110#;
No spaces are allowed between '#'s. The minus sign goes out front,
and you need a semicolon at the end. See the syntax for "based literals"
in RM95 2.4.2.
: --
: Please mail replies to :
: utopian@pl.jaring.my
I did that too.
-Tucker Taft stt@inmet.com http://www.inmet.com/~stt/
Intermetrics, Inc. Burlington, MA USA
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-04-03 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-31 0:00 How to calculate negative binary?? Centaury
1997-03-31 0:00 ` Mark A Biggar
1997-04-03 0:00 ` Tucker Taft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox