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:logarithmic_and_exponential



Logarithmic and Exponential Functions

These functions calculate exponentials and logarithms.

e()

Returns Euler's number.

Argument Type Description
none No arguments.

Returns: number.

Example:

e();
log(e());       // 1

exp(x)

Returns Euler's number raised to `x`.

Argument Type Description
`x` number Exponent.

Returns: number.

Example:

exp(1);         // e

exp10(x)

Returns 10 raised to `x`.

Argument Type Description
`x` number Exponent.

Returns: number.

Example:

exp10(3);       // 1000

exp2(x)

Returns 2 raised to `x`.

Argument Type Description
`x` number Exponent.

Returns: number.

Example:

exp2(8);        // 256

expm1(x)

Returns `exp(x) - 1`.

Argument Type Description
`x` number Exponent.

Returns: number.

This form is useful for small values where `exp(x) - 1` would lose precision.

Example:

expm1(0);       // 0

log(x)

Returns the natural logarithm of `x`.

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

Returns: number.

Example:

log(e());       // 1

log10(x)

Returns the base-10 logarithm of `x`.

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

Returns: number.

Example:

log10(1000);    // 3

log1p(x)

Returns `log(1 + x)`.

Argument Type Description
`x` number Input value. Must be greater than `-1`.

Returns: number.

This form is useful for small values of `x`.

Example:

log1p(0);       // 0

log2(x)

Returns the base-2 logarithm of `x`.

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

Returns: number.

Example:

log2(256);      // 8

Previous: Algebra

Next: Trigonometric

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

Page Tools