math.sqrt

From ComputerCraft
Jump to navigation Jump to search

math.sqrt
Function
Syntax
math.sqrt()
Returns number
API math
Source Lua (source)

Returns the square root of num.

ExampleExamplePrint the square root of 2.
Prints an approximation of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \sqrt{2}} .
Code
print(math.sqrt(2))
Output 1.4142135623731