Numeric Functions in FoxPro

Submitted by Karthikeyan on

Function

Description

Example & Output

Abs()

Returns absolute value of the specified numeric expression

abs(-17)

17

Int()

Returns integer value

int(17.15)

17

Floor()

Returns nearest integer value that is less than or equal to the given number

Floor(17.85)

17

Ceil()

Returns nearest integer value that is higher than or equal to the given number

Floor(17.85)

18

Mod()

Returns remainder value

Mod(45,6)

3

Round()

Returns a numeric value rounded to a specified number of decimal

Round(17.85) => 18

Round(17.15) => 17

Min()

Returns lowest value from the list of values given (based on ASCII value – applicable to numbers, characters, date expressions)

Min(10,17,18,5) => 5

Max()

Returns highest value from the list of values given (based on ASCII value – applicable to numbers, characters, date expressions)

Min(10,17,18,5) => 18

Sqrt()

Returns square root of the given expression

Sqrt(144) => 12

Log()

Returns logarithmic value of the given expression.

Log(10) => 2.30259

Log10()

Returns logarithmic base 10 value of the given expression.

Log10(10) => 1.0000

Acos()

Returns cosine value of the given expression

Similarly, asin(), atan() can also be used.

Acos(0.5) = > 1.0472

Tags
Recommended :
FoxPro e-Book
  1. FoxPro Programming Quick Reference e-Book (New! Revised Edition)