this post was submitted on 22 Oct 2023
573 points (95.7% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
(page 2) 33 comments
sorted by: hot top controversial new old
[–] cpw@lemmy.ca 4 points 2 years ago

Max11 is all my code. Why doesn't it work????πŸ€”

[–] affiliate@lemmy.world 3 points 2 years ago

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).

[–] GTG3000@programming.dev 3 points 2 years ago

Why use const max = (x, y) => x > y ? x : y instead of function max(x, y) { return x > y ? x : y } ?

[–] crandlecan@mander.xyz 3 points 2 years ago

I'm mostly lost and in over my head

[–] scroll_responsibly@lemmy.sdf.org 1 points 2 years ago* (last edited 2 years ago)

my $max = $x > $y ? $x : $y;

load more comments
view more: β€Ή prev next β€Ί