Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Opposite of ABS?

Author
Message
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 14th Feb 2003 21:30
ABS() gets the positive number of a negative...
e.g. -100 becomes 100

Is there a function for getting the negative number of a positive?

e.g 100 becomes -100

Thanks.
DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Feb 2003 21:38
Yes, multiply by -1, or subtract from 0

x=x*-1
x=0-x
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 14th Feb 2003 21:43
Ahh thanks

*** I only got 64% in my maths exam so...thanks ***

L8rz, IanM

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!

Login to post a reply

Server time is: 2024-09-19 18:12:16
Your offset time is: 2024-09-19 18:12:16