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 Answer

added 93 characters in body
Source Link
Stef
  • 957
  • 4
  • 16

Python 3.8 (pre-release), 40 bytes

ThisAll other python answers are limited to integers smaller than about 10**16.

Here is one that works with all python integers, giving the correct result even for arbitrarily large integers. Always rounds down.

lambda x:isqrt(x*x//2)
from math import*

Try it online!

Python 3.8 (pre-release), 40 bytes

This one works with python integers, giving the correct result even for arbitrarily large integers. Always rounds down.

lambda x:isqrt(x*x//2)
from math import*

Try it online!

Python 3.8 (pre-release), 40 bytes

All other python answers are limited to integers smaller than about 10**16.

Here is one that works with all python integers, giving the correct result even for arbitrarily large integers. Always rounds down.

lambda x:isqrt(x*x//2)
from math import*

Try it online!

Source Link
Stef
  • 957
  • 4
  • 16

Python 3.8 (pre-release), 40 bytes

This one works with python integers, giving the correct result even for arbitrarily large integers. Always rounds down.

lambda x:isqrt(x*x//2)
from math import*

Try it online!

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