# FunctionsEdit

## IsNanEdit

*Function IsNan( x:Double )*

**Description**: Check if a value is NAN

**Returns**: True if **x** is 'not a number' (e.g.: Sqr(-1))

**Example**:

Local a:Float = Sqr(-1) Local b:Int = IsNan(a) 'b will equal True in this example, because the square root of -1 is 'not a number'

## IsInfEdit

*Function IsInf( x:Double )*

**Description**: Check if a value is infinite (e.g.: 1.0/0.0)

**Returns**: True if **x** is infinite

**Example**:

Local a:Float = 1.0 / 0.0 Local b:Int = IsInf(a) 'b will equal True in this example, because 1.0 divided by 0.0 is infinite

## SqrEdit

*Function Sqr:Double( x:Double )*

**Description**: Square root of **x**

**Example**:

Local a:Int = 4 Local b:Int = Sqr(a)

## SinEdit

*Function Sin:Double( x:Double )*

**Description**: Sine of **x** degrees

## CosEdit

*Function Cos:Double( x:Double )*

**Description**: Cosine of **x** degrees

## TanEdit

*Function Tan:Double( x:Double )*

**Description**: Tangent of **x** degrees

## ASinEdit

*Function ASin:Double( x:Double )*

**Description**: Inverse Sine of **x**

**Comments**:
The inverse sine can determine the remaining angles of a right triangle when the lengths of the sides are known. For instance, an angle may be calculated using the length of the opposite side and the hypotenuse.

**Example**:

Local alpha:Double = ASin(length_opposite / length_hypotenuse)

## ACosEdit

*Function ACos:Double( x:Double )*

**Description**: Inverse Cosine of **x**

**Comments**:
The inverse cosine can determine the remaining angles of a right triangle when the lengths of the sides are known. For instance, an angle may be calculated using the length of the adjacent side and the hypotenuse.

**Example**:

Local alpha:Double = ACos(length_adjacent / length_hypotenuse)

## ATanEdit

*Function ATan:Double( x:Double )*

**Description**: Inverse Tangent of **x**

**Comments**:
The inverse tangent can determine the remaining angles of a right triangle when the lengths of the sides are known. For instance, an angle may be calculated using the length of the opposite side and the adjacent side.

**Example**:

Local alpha:Double = ATan(length_opposite / length_adjacent)

## ATan2Edit

*Function ATan2:Double( y:Double,x:Double )*

**Description**: Inverse Tangent of two variables **x** , **y**

**Comments**:
ATan2 is similar to ATan. However, it makes use of the two arguments signs to determine the angle of a imaginary vector (x,y) relatively to the x-axis (counterclockwise). This is very useful, for example in determining the direction from one point to another.

**Example**:

Local ax:Float = -1, ay:Float =- 2 'Point A Local bx:Float = 3, by:Float = 2 'Point B 'Notice how the variables we are using are Float's, BlitzMax will automatically 'convert them into Double's when we call ATan2() Local angle:Float = ATan2(by - ay, bx - ax) 'Angle from A to B

## SinhEdit

*Function Sinh:Double( x:Double )*

**Description**: Hyperbolic sine of **x**

## CoshEdit

*Function Cosh:Double( x:Double )*

**Description**: Hyperbolic cosine of **x**

## TanhEdit

*Function Tanh:Double( x:Double )*

**Description**: Hyperbolic tangent of **x**

## ExpEdit

*Function Exp:Double( x:Double )*

**Description**: Exponential function

## LogEdit

*Function Log:Double( x:Double )*

**Description**: Natural logarithm

## Log10Edit

*Function Log10:Double( x:Double )*

**Description**: Base 10 logarithm

## CeilEdit

*Function Ceil:Double( x:Double )*

**Description**: Smallest integral value not less than **x**

## FloorEdit

*Function Floor:Double( x:Double )*

**Description**: Largest integral value not greater than **x**

**Comments**:
Ceil() will round a variable up, whereas Floor() will round it down.

**Example**:

Local a:Float = 3.5 Local round_up:Float = Ceil(a) 'Becomes 4.0 Local round_down:Float = Floor(a) 'Becomes 3.0