by rottingtree · 9y ago · 0 comments
int a = 5;
a = !!a;
printf("%i", a); // -> 1
my handwavy approach, negation is either information preserving, or not. If operations destroy data, you have to be extra careful. I think classical logic runs into some subtlety switching from reals to integers and back to reals - how are you rounding or truncating those values?Information erasure is a handy thing to keep track of.