cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
very simple
very simple
Mar 21, 2011 at 3:35pm UTC
hunkeelin
(159)
what is
n = (n<0) ? -n : n;
means?
Mar 21, 2011 at 3:46pm UTC
Bazzy
(6281)
It's the conditional operator
it means
1
2
3
4
if
( n < 0 ) n = -n;
else
n = n;
http://www.cplusplus.com/doc/tutorial/operators/
Mar 21, 2011 at 4:16pm UTC
moorecm
(1932)
In mathematics, it means: n = |n|
Topic archived. No new replies allowed.