Sidebar

Home



Expressions V4


Tutorials

How-To

Reference

  Lexical basics
  Type system
  Variables and assignment
  Operators
  Expression rules
  Control flow
  Functions
  Built-in functions
   None and NaN
   Arithmetic
   Algebra
   Logarithmic and Exponential
   Trigonometric
   Rounding and Centering
   Strings
   Output, Formatting, Clipboard, and Errors
   Dialog Functions
   Platform and Paths
  Methods and properties
  Built-in methods
   Common Value Methods
   Number Methods
   String Basic Methods
   String Slice Methods
   String Parsing Methods
   String Formatting Methods
   String Regex Methods
   String Trim and Case Methods
  Objects
  Built-in objects
   Global objects
    settings
    controller
    session
    python
   Collections
    array
    map
    bytes
   File Format I/O
    image_data
    image_stream
   Utils
    crypto
    timer
   Comm
    serial
   Dialogs
    file_open
    file_save
    msg_ok
    msg_ok_cancel
    msg_yes_no
    msg_password
   GUI objects
    window
    panel
    group
    splitpanel
    label
    textbutton
    drawablebutton
    togglebutton
    togglegroup
    textinput
    textedit
    numinput
    slider
    combobox
    listbox
    progressbar
    led
    separator
    menu
    image
    snake
  Classes and user-defined objects
  Include system
  Error model
  Execution model and sessions
  Host integration
  Limits and performance
  Formal reference
  Glossary

Cookbook

exprv4:reference:functions:algebra



Algebra Functions

Algebra built-in functions perform common power and root calculations.

cbrt(x)

Returns the cube root of a number.

Argument Type Description
`x` number Input value.

Returns: number.

Example:

cbrt(27);       // 3

cube(x)

Returns `x * x * x`.

Argument Type Description
`x` number Input value.

Returns: number.

Example:

cube(3);        // 27

pow(base, exponent)

Raises `base` to `exponent`.

Argument Type Description
`base` number Base value.
`exponent` number Exponent value.

Returns: number.

Errors:

  • `0` raised to a negative exponent is invalid.
  • A negative base with a non-integer exponent is not supported.
  • Overflow is reported as an error.

Example:

pow(2, 8);      // 256

sqr(x)

Returns `x * x`.

Argument Type Description
`x` number Input value.

Returns: number.

Example:

sqr(12);        // 144

sqrt(x)

Returns the square root of a number.

Argument Type Description
`x` number Input value. Must be greater than or equal to zero.

Returns: number.

Example:

sqrt(25);       // 5

Previous: Arithmetic

Next: Logarithmic and Exponential

exprv4/reference/functions/algebra.txt · Last modified: by andrej

Page Tools