Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

2 of 3
added 37 characters in body
Kaddath
  • 2.9k
  • 5
  • 9

PHP, 16 bytes

$argn/sqrt(2)|0;

Try it online! (with highest value supported on TIO)

Uses @Niphram's truncate method (which in PHP also has the ability to convert the float to an int)

I know it's trendy to say PHP is to be hated, but I kinda came to like its oddities, and it gives me a chance to add an original answer

EDIT: saved 4 bytes using <?= php tag (no need to echo)

Kaddath
  • 2.9k
  • 5
  • 9

AltStyle によって変換されたページ (->オリジナル) /