Overcomplicated Negative Check
static int IsNegative(float arg) { char*p = (char*) malloc(20); sprintf(p, "%f", arg); return p[0]=='-'; }
A graduate in a cap and gown reads a needlessly complicated C function that checks whether a floating-point number is negative by converting it to text and inspecting the first character. The joke is aimed at inefficient, overengineered programming solutions and is shared as a reaction to unnecessarily convoluted code. EN: A graduate in a cap and gown reads a needlessly complicated C function that checks whether a floating-point number is negative by converting it to text and inspecting the first character. The joke is aimed at inefficient, overengineered programming solutions and is shared as a reaction to unnecessarily convoluted code.
- @gentoomemes / 9056 2024-01-30
- Type
- image
- Size
- 694×732 · 34.3 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added