Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
OkGoDoIt
on Aug 20, 2020
|
parent
|
context
|
favorite
| on:
Math.min(Math.max(num, min), max)
I had no idea .NET has Clamp() now. I’ve been writing something like the OP all this time ️
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: