Index:
[thread]
[date]
[subject]
[author]
From: Robert C. Duvall <rcd@cs.duke.edu>
To :
Date: 01 Feb 1999 23:45:14 -0500
Re: Unary Negation Operator
> 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]