Skip to main content
Module

x/denops_std/function/mod.ts>sqrt

📚 Standard module for denops.vim
Go to Latest
function sqrt
import { sqrt } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Return the non-negative square root of Float {expr} as a Float. {expr} must evaluate to a Float or a Number. When {expr} is negative the result is NaN (Not a Number). Returns 0.0 if {expr} is not a Float or a Number. Examples:

:echo sqrt(100)

    10.0

:echo sqrt(-4.01)

    nan

"nan" may be different, it depends on system libraries.

Can also be used as a method:

Compute()->sqrt()

Parameters

denops: Denops
expr: unknown

Returns

Promise<number>