3.5.1.1.13 Floor


Description

Minimum Origin Version Required: 2019 SR0

This function returns a value by adjusting the given value x towards from 0 and to the multiple of sig nearest to x. That is,

  • if x > 0 and sig > 0, returns a value rounded down towards 0.
  • if x > 0 and sig < 0, returns missing.
  • if x < 0 and sig > 0, returns a value rounded down away from 0.
  • if x < 0 and sig < 0, returns a value rounded up towards 0.
  • if sig = 0, returns 0.


Syntax

double Floor( double x[, double sig])

Parameters

x

can be any real number.

sig

Optional. can be any real number. If sig is not specified, default value 1 is used.

Return

Returns a value (or dataset) adjusting x towards 0 and to the nearest multiple of sig.

Example

Floor(2.9714, 2)=;     // ANS: floor(2.9714, 2)=2
Floor(2.9714)=;        // ANS: floor(2.9714)=2
Floor(-2.9714, -2)=;   // ANS: ceil(-2.9714, -2)=-2

See Also

Ceil