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 40 characters in body
Source Link
user85052
user85052

Pyth, 6 bytes

Port ofThe division auto-casts the Python answers.number to a decimal!? (IsIn seriousness, is there a square root function in Pyth?)

/Q@2 2

Try it online!

Explanation

 @2 2 to the power of
 2 1/2 (effectively calculates math.sqrt(2))
/Q Divide the (evaluated) input by that number

Pyth, 6 bytes

Port of the Python answers. (Is there a square root function in Pyth?)

/Q@2 2

Try it online!

Explanation

 @2 2 to the power of
 2 1/2 (effectively calculates math.sqrt(2))
/Q Divide the (evaluated) input by that number

Pyth, 6 bytes

The division auto-casts the number to a decimal!? (In seriousness, is there a square root function in Pyth?)

/Q@2 2

Try it online!

Explanation

 @2 2 to the power of
 2 1/2 (effectively calculates math.sqrt(2))
/Q Divide the (evaluated) input by that number
Source Link
user85052
user85052

Pyth, 6 bytes

Port of the Python answers. (Is there a square root function in Pyth?)

/Q@2 2

Try it online!

Explanation

 @2 2 to the power of
 2 1/2 (effectively calculates math.sqrt(2))
/Q Divide the (evaluated) input by that number

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