Functions > Numerical Manipulations and Number Theory

The following functions are described in this section

 01. abs 02. ceil 03. fib 04. fibs 05. floor 06. isprime 07. prime 08. primesto 09. primes 10. rand 11. randlist 12. round 13. truncate

### abs

Gets the absolute value(s) of the given value(s), array or matrix using one of the following forms:

1. abs(value_1, value_2, ..., value_n)
2. abs(array | matrix)

Note: The pipe (|) symbol shows that any one of the provided types are allowed to be passed as parameter.

### ceil

Gets the ceiling value(s) of the given value(s), array or matrix using one of the following forms:

1. ceil(value_1, value_2, ..., value_n)
2. ceil(array | matrix)

Note: The pipe (|) symbol shows that any one of the provided types are allowed to be passed as parameter.

### fib

Gets the Fibonacci number at the given zero based index. The format of this function is:

fib(index)

### fibs

Gets the first N Fibonacci numbers. Its format is:

fibs(count), where count specifies the number of items in the returned Fibonacci sequence.

### floor

Gets the floor value(s) of the given value(s), array or matrix using one of the following forms:

1. floor(value_1, value_2, ..., value_n)
2. floor(array | matrix)

Note: The pipe (|) symbol shows that any one of the provided types are allowed to be passed as parameter.

### isprime

Checks whether the given number is prime or not. Returns true if it is prime. Otherwise returns false.

### prime

Returns the prime number at the specified zero based index.

### primesto

Returns the prime numbers from the sequence of positive integers upto and including the number specified as parameter. This function perfoms faster than the primes() function described next.

### primes

Returns the first N (specified as parameter) numbers from the sequence of prime numbers.

### rand

Generates a random number. It has the following format

rand([seed])

seed is an optional number to provide an initial seed to the Random Number Generator.

### randlist

Generates a list of random numbers. It has the following format

randlist(count, [seed])

count is the size of the resulting array containing random numbers. seed is an optional number to provide an initial seed to the Random Number Generator.

### round

Rounds its argument(s) (values, array or matrix) to the nearest integer or specified number of decimal places using one of the following forms

1. round(value | array | matrix): Rounds to the nearest integer.
2. round(value | array | matrix, digits): Rounds to the specified number of fractional digits

Note: The pipe (|) symbol shows that any one of the provided types are allowed to be passed as parameter.

### truncate

Gets the integral part of the specifed argument(s). The function has the following two forms:

1. truncate(value_1, value_2, ..., value_n)
2. truncate(array | matrix)

Note: The pipe (|) symbol shows that any one of the provided types are allowed to be passed as parameter.