RE: Quick question on math in C

"Ammaross Danan" <[email protected]>
Newsgroups gmane.games.devel.mud.rom
Message-ID <[email protected]>
Number * -1

Or

#include <math.h>
Number = abs(Number);

Use the later if you always want it to be positive, the first could
potentially make it go negative if it was positive to begin with...

Ammaross
www.rotf.net

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of cyhawk
Sent: Saturday, April 16, 2005 1:54 PM
To: [email protected]
Subject: Quick question on math in C

Err how would i convert a negitive number to a positive number?
ie -5 to 5
or -754 to 754
in c?

Google was no help cause i have no idea how to form the question ;) Thanks
=)
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom

-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.