• 41 Posts
  • 715 Comments
Joined 2 years ago
cake
Cake day: June 10th, 2024

help-circle









  • there’s integer overflow and integer underflow. when you have an 8-bit signed integer variable: signed char x = 127 and you try to increment it by 1: signed char y = x + 1 and then you print y: `printf(“%d\n”, int(y))", it will print -128. the reason is integer overflow, kinda like when you add 1 to 999, you get 1000. but if the variable can only store 3 digits, you get 000 instead, which is 0. the computer interprets that as a negative value though because of offset etc.

    the same works in reverse. -999 - 1 = -1000 which gets interpreted as -000 which gets interpreted as a positive number then.









  • recommendation: if you wanna go out to meet someone, but don’t want to spend a lot of money at restaurants, consider going to the nearest supermarket and getting take-out prepackaged food. like, some supermarkets have a section to prepare bread with fillings (cheese etc), sweet baked stuff, coffee, etc.

    especially pre-packaged coffee ready-to-drink at a supermarket costs 0.90€ around here which is not beatable by any kind of “coffee shop” restaurant.