what is the difference between floor() and rounddown() function or ceiling() and roundup() function ?
Discussion posts and replies are publicly visible
Hi paragk998 ,
1.Floor() and Rounddown()
Floor()
Basically the floor function takes as input a real number x and gives as output the greatest integer less than or equal to x.
For e.g. floor(2.8888) will return 2
Rounddown()
And Rounddown() rounds the number down to the specified digit.
rounddown( number, [num_digits] )
number: (Decimal) The number to be rounded.
num_digits: (Integer) Determines the digit or place to which the number will be rounded down to the nearest 10^(-num_digits). 2 is default.
rounddown(7.36819) returns 7.36
rounddown(7.36819)
7.36
rounddown(7.36819, 3) returns 7.368
rounddown(7.36819, 3)
7.368
rounddown(7.36879, 3) returns 7.368
rounddown(7.36819, 4) returns 7.3681
rounddown(7.36819, 4)
7.3681
2.Ceiling() and Roundup()
Ceiling()
The ceiling function maps X to the least integer greater than or equal to X
For e.g. ceiling (2.8888) will return 3
Roundup()
Rounds the number up to the specified digit.
roundup( number, num_digits )
num_digits: (Number) Determines the digit or place to which the number will be rounded up to the nearest 10^(-num_digits). 2 is default.
roundup(7.36819) returns 7.37
roundup(7.36819)
7.37
roundup(7.36819, 3) returns 7.369
roundup(7.36819, 3)
7.369
roundup(7.36819, 4) returns 7.3682
roundup(7.36819, 4)
7.3682
Hi parag,
floor() :- Rounds the number down to the nearest multiple of the specified significance.
floor(2.8888, .0124568) returns 2.877521floor(-7,5) returns -10
floor(-7,5)
-10
rounddown() :- Rounds the number down to the specified digit.
rounddown(7.36819, 4) returns 7.3681ceiling() :- Rounds the number up to the nearest multiple of the specified significance.
7.3681ceiling() :- Rounds the number up to the nearest multiple of the specified significance.
ceiling(7.32,.5) returns 7.5
7.5
ceiling(1.6) returns 2
roundup() :- Rounds the number up to the specified digit.