Sqrt (Function) — Skript

Addon: Skript · Category: Function

Syntax

sqrt(n: number) :: number

Description

The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as <code>(argument) ^ (1/2)</code> – other roots can be calculated via <code>number ^ (1/root)</code>, e.g. <code>set {_l} to {_volume}^(1/3)</code>. Returns NaN (not a number) if the argument is negative.

Examples

sqrt(4) = 2
sqrt(2) = 1.4142
sqrt(-1) = NaN

View source