this post was submitted on 15 Jan 2025
114 points (93.8% liked)
Programming
17832 readers
107 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Some languages define True as -1, which is NOT False...
You really didn't need this; I would have just assumed that you were speaking the truth.
CONST False = 0, True = NOT False
NOT as in the binary operator. What's NOT of 0 in a 32 bit space? 0xFFFFFFFF, which is -1, which is ≠ 1
Different languages, and even different programmers might interpret the concept and definition of True and False differently, so to save any ambiguity and uncertainty, defining your own critical constants in your own library helps make sure your code is robust.
So... all that is NOT False either, I presume?
they mean every bit is different
I don't know; their comment seemed pretty much the same throughout...
I once wrote a library to replace an older one. Someone did this, and users were multiplying variables by booleans and negating them in formulas.
I just made the new library less stupid and left the users to clean up their mess when migrating.