Jump to content
  • Advertisement
Sign in to follow this  
3dcgmodeling

bool and integer

This topic is 4094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Quote:
Original post by Antheus
True.

bool value of false is equivalent to 0, any other value is equivalent to true;


I thoguht -1 was false? :(

Share this post


Link to post
Share on other sites
Crazyfool, some languages (QBasic, probably others) define false as 0, and true as -1, since in binary 0 is all 0's and -1 is all 1's (and hence true is a binary not of false).

C and C++ however treat any value except 0 as true.

Share this post


Link to post
Share on other sites
Quote:
Original post by sphen_lee
Crazyfool, some languages (QBasic, probably others) define false as 0, and true as -1, since in binary 0 is all 0's and -1 is all 1's

Sure, if your processor does calculations in twos complement.

[Edited by - jflanglois on April 5, 2007 11:42:47 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!