Max11 is all my code. Why doesn't it work????π€
this post was submitted on 22 Oct 2023
620 points (95.7% liked)
Programmer Humor
32570 readers
138 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
Thief, or Procrastinator.
Yoink.
Actually I've probably been all of these at various times in my career.
I use 8, but only when I'm operating on unsigned longs.
I'm mostly lost and in over my head
Why use
const max = (x, y) => x > y ? x : y
instead of
function max(x, y) { return x > y ? x : y }
?
hereβs another mathematical approach (that has the added benefit of only working when x and y are both positive).
let f denote the linear functional on β^2^ defined by f(1,0) = x and f(0,1) = y (and extend by linearity). then the operator norm || f || is equal to max(x,y).
2, but I'm incredibly embarrassed to say that I've had to do 9 before
load more comments
(2 replies)