I’ll be honest. I think I accidentally bolded it. Typed it on my phone, so yeah. Anyway, did not know that int max is different in other things. I just always assumed ints in everything were 32-bit and never considered that.
yeah, but how many people have that character on their keyboards? everyone knows boolean algebaeists are the lazyist brand, they only accept two answers.
This is the same way decimal math works, just with fewer digits.
In decimal math, you roll over after 9, so each place can hold up from 0 to 9 of whatever value it is, ie after 9 you get 10, and after 99 you get 100. A 1 in any position means that there 10 of whatever place came before it.
In binary math, we only have two digits, so it rolls over after 1. After 1 you get 10, and after 11 you get 100.
That means
Binary | Decimal
________________
0 | 0
1 | 1
10 | 2
11 | 3
100 | 4
101 | 5
110 | 6
111 | 7
So instead of place values going up by values of 10, they go up by powers of 2.
In decimal, 999 = 900 + 90 + 9
In binary, 111 (7) = 100 (4) + 10 (2) + 1 (1)
Like a digital clock, the left flips to the next hour once the right digits count up. Like carrying the 'tens' forward in addition. They push out the left digit.
Lol what are you on about? That's just binary. Yes ipv4 uses binary, but represented in decimal form cause it's easier to write a subnet mask like 255.255.255.0 than to write out 24 1s and 8 0s
111
u/Crafty-Detail-3788 2d ago •
Modular arithmetic : 1+1=0
70
u/gilmeye 2d ago
"B" + "a" + +"a" + "a" = "BaNaNa"
45
u/Local_Surround8686 2d ago
r/firstweekcoderhumor
28
u/promptmike 2d ago •
DEC 25 = OCT 31
🎄 = 🎃
19
u/hopeless__programmer 2d ago
JavaScript: 1+"1" = "11"
16
u/LonelyPoorMan69 2d ago
Programmers like me:
*Gets PTSD*
9
u/Kanjii_weon 2d ago
if true = true
8
u/Wushia52 2d ago
MAGA zero sum math: 1 + 1 <= 0.
5
u/SnooMaps7370 2d ago
1+1 could also = 0, if they're meeting at a XOR gate.
2
u/Key_River7180 2d ago
EASY! 2 + 2 = 0, can't you see this is a 2 bit integer?
2
u/Basic_Reporter9579 2d ago
1 + 1 = 0 and a curry bit.
3
u/y0shii3 2d ago
I hate when + is used for the disjunction operator
1
u/user_bw 2d ago
Boolean is more like something plus something is something. something nothing times is nothing.
1
u/looopTools 2d ago
Finite fields: 1 + 1 = 0
1
u/Responsible-Sky-1336 1d ago
Balanced ternary
1
u/sparkleshark5643 56m ago
True plus True equals a syntax error. True or True equals True
1
u/MinosAristos 2d ago
Y'all need to review New Math
https://youtu.be/UIKGV2cTgqA?is=0_xvlzJU9FZC9fNq
-1
u/themagicalfire 2d ago edited 1d ago
In binary 1+1 is 3 because the numbers multiply on the left:
11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
-1
u/future_pirate 1d ago edited 1d ago
IT systems guy here, in subnetting math 1+1=3, 1+1+1=7, 1+1+1+1+1+1+1+1=255