comp.lang.ada
 help / color / mirror / Atom feed
From: mab@dst1.wdl.loral.com (Mark A Biggar)
Subject: Re: How to calculate negative binary??
Date: 1997/03/31
Date: 1997-03-31T00:00:00+00:00	[thread overview]
Message-ID: <5hopf0$50q@wdl1.wdl.lmco.com> (raw)
In-Reply-To: 01bc3bf9$a8a655e0$d87d8ea1@AaBbCcDd


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







  reply	other threads:[~1997-03-31  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-31  0:00 How to calculate negative binary?? Centaury
1997-03-31  0:00 ` Mark A Biggar [this message]
1997-04-03  0:00 ` Tucker Taft
replies disabled

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