Fun fact: C doesn’t even guarantee a + b == a + b
Comment on Equality
lowleveldata@programming.dev 2 years ago
Actually we don’t know whether 2+3 equals to 3+2 without seeing the definition of the + operator
barsoap@lemm.ee 2 years ago
lowleveldata@programming.dev 2 years ago
*If a and b are
floatbarsoap@lemm.ee 2 years ago
Or signed integers because overflow is undefined.
zea_64@lemmy.blahaj.zone 2 years ago
C doesn’t even guarantee a == a
Viking_Hippie@lemmy.world 2 years ago
That’s decidedly unfun and headhurty for those of us less mathemstically inclined. Also so deep into the theoretical weeds that I’m not sure that “fact” applies…
barsoap@lemm.ee 2 years ago
One night I dreamt about the new C standard. It was a tome of ten thousand pages, in dense, tiny, font, three columns of text on each page, and it was headings and sub-headings interspersed with nothing but either “undefined” or “implementation-defined”.
FuglyDuck@lemmy.world 2 years ago
If
1 x 0 = 0
And
2 x 0 = 0
Then 1 = 2.
And this folks is why you don’t hire “math teachers” because he was successful football coach. It took him way too long to realize this is why we don’t divide by zero, (more than a week, actually.)