Skip to main content
Module

x/denops_std/function/mod.ts>abs

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

Return the absolute value of {expr}. When {expr} evaluates to a Float abs() returns a Float. When {expr} can be converted to a Number abs() returns a Number. Otherwise abs() gives an error message and returns -1. Examples:

echo abs(1.456)

    1.456

echo abs(-5.456)

    5.456

echo abs(-4)

    4

Can also be used as a method:

Compute()->abs()

Parameters

denops: Denops
expr: unknown

Returns

Promise<number>