[futurebasic] Re: Stuff

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

From: tatewake@... (Terence Jordan)
Date: Sun, 23 Nov 1997 11:21:15 -0400
>Is there a quick, one command way of changing the sign of a number... say
>from 102.092 to -102.092?
>
>I'm using a fairly simple method at the moment, but elegant it aint. I
>wouldn't want my wife or kids to see it.

Usually:

X=-X

Works just fine; it's the way we country folk' calca'late...
and if you don't ah pree she ate it, I'll sick Duke on you...!

Sick 'em, Duke!

seriously, that's the "single command" method; if you're looking for
elegance, try:

X=-SGN(X)*X

But what is the "unelegant code" you _are_ using?



-- Terence Jordan (tatewake@...)
Inspired Software. http://inspired.netstreet.net/
Macintosh, Dos, Windows, and BeOS software solutions.
Phone: 407-728-7563
............................................
. New: Renegade Space Ninja for Macintosh! .
.      Visit our page for more info.       .
............................................