[futurebasic] Re: Stuff

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sun, 23 Nov 1997 09:29:40 -0600
> << Is there a quick, one command way of changing the sign of a number... say
> from 102.092 to -102.092? >>
> 
> >Al Staffieri Jr. suggested:
> >X = X - (X * 2)
> >
> >If X is a negative number, it will become positive. If it's positive it will
> >become a negative.
> 
> True but not -X in either case!     {:-[
> 
> Perhaps Al meant X = X - (X * 2)/X, which does work for negating X.
> 
> Note:
> X = X * (-1) is simpler,
> But I suspect the original questioner sought a bit twiddling solution?

Maybe I'm missing something here...why not just use the most obvious
solution? Namely:

  X = -X

- Rick