Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function

sqrt — square root of a number

Synopsis

sqrt(val: number) -> float64

Description

The sqrt function returns the square root of its argument val, which must be numeric. The return value is a float64. Negative values result in NaN.

Examples


The square root of various numbers

# spq
values sqrt(this)
# input
4
2.
1e10
-1
# expected output
2.
1.4142135623730951
100000.
NaN