Index:
[thread]
[date]
[subject]
[author]
From: Brain Robert Appel <bra@ee.duke.edu>
To :
Date: Tue, 02 Feb 1999 13:19:40 -0500
Re: Unary Negation Operator
What if we implement both say :
" - 2" is substract 2 from last answer
" -2" is negative 2
((Extra Credit?))
"Robert C. Duvall" wrote:
> > I'm having trouble trying to understand the point of the "-" operator.
> > How do we differentiate between making a number negative and subtracting
> > from the previous answer?
> >
> > For example, what should happen in this test run:
> >
> > > b = 6
> > 6
> > > 3 + 4
> > 7
> > > - b
> >
> > Should this subtract 6 from 7 or should this make b equal to -6?
>
> As posted previously, this is an ambiguity in the specification and
> you should handle it any way you feel is appropriate so long as you
> DOCUMENT your choice clearly.
>
> rcd
>
> --
> Robert C. Duvall
> Lecturer, Duke University
> rcd@cs.duke.edu
Index:
[thread]
[date]
[subject]
[author]