TTCalc is an open source bignum mathematical calculator.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

#### 73 lines 1.6 KiB Raw Blame History

 `` `` `` ` TTCalc - Rounding functions` ` ` ` ` `` `` `

Arithmetic functions

` `

Note: If a function takes more than one argument, the arguments are separated with semicolon ';'.

` `

Rounding functions

` `
` `
int(x)
` `
This method returns only the integer part of x.
` `int(2.8)=2
` `int(2.2)=2
` `int(2)=2
` `int(-4.1)=-4
` `int(-4.8)=-4
` `
` `
round(x)
` `
This method rounds the value of x to the nearest integer
` `round(2.8)=3
` `round(2.2)=2
` `round(2)=2
` `round(-4.1)=-4
` `round(-4.8)=-5
` `
ceil(x)
` `
This function returns a value representing the smallest integer that is greater than or equal to x
` `ceil(2.8)=3
` `ceil(2.2)=3
` `ceil(2)=2
` `ceil(-4.1)=-4
` `ceil(-4.8)=-4
` `
floor(x)
` `
This function returns a value representing the largest integer that is less than or equal to x
` `floor(2.8)=2
` `floor(2.2)=2
` `floor(2)=2
` `floor(-4.1)=-5
` `floor(-4.8)=-5
` `
frac(x)
` `
This function returns a value without the integer part - only fraction remains
` `frac(45.789)=0.789
` `frac(-2.267)=-0.267
` `
` `` ``` ``` ``` ```