Be a Supporter!

negatives in C++

  • 440 Views
  • 5 Replies
New Topic Respond to this Topic
The-EXP
The-EXP
  • Member since: May. 3, 2004
  • Offline.
Forum Stats
Supporter
Level 16
Blank Slate
negatives in C++ 2005-12-15 20:27:27 Reply

do negative numbers in C++ count as true or false?


Giant Biscuits

thoughtpolice
thoughtpolice
  • Member since: Mar. 24, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to negatives in C++ 2005-12-15 20:31:18 Reply

Generally anything other than 0 is false. That's why loops like while(1) work.


omg.
Playstation Network tag: muffin-noodle
the empty set

0x41
0x41
  • Member since: Dec. 30, 2004
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to negatives in C++ 2005-12-15 20:32:58 Reply

In C++ any non-zero number [including negatives] evaluates to true.

The-EXP
The-EXP
  • Member since: May. 3, 2004
  • Offline.
Forum Stats
Supporter
Level 16
Blank Slate
Response to negatives in C++ 2005-12-15 20:39:07 Reply

thanks you guys


Giant Biscuits

Ravens-Grin
Ravens-Grin
  • Member since: Jun. 3, 2003
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to negatives in C++ 2005-12-15 23:16:13 Reply

Now do you want the bit representation of a negative number in C++?

XeonXT
XeonXT
  • Member since: Aug. 27, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to negatives in C++ 2005-12-17 21:46:51 Reply

At 12/15/05 11:16 PM, Ravens_Grin wrote: Now do you want the bit representation of a negative number in C++?

wtfbbq?

pffff showoff