difference between floor() and rounddown() function

Certified Lead Developer

what is the difference between floor() and rounddown() function or ceiling() and roundup() function ?

  Discussion posts and replies are publicly visible

Parents
  • 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

    x Floor X Ceiling X  
    2 2 2  
    2.4 2 3  
    2.9 2 3  
    −2.7 −3 −2  
    −2 −2 −2  

    Rounddown()

    And Rounddown() rounds the number down to the specified digit. 

    rounddownnumber, [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.

     For e.g.

    rounddown(7.36819) returns 7.36

    rounddown(7.36819, 3) returns 7.368

    rounddown(7.36879, 3) returns 7.368

    rounddown(7.36819, 4) returns 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.

    roundupnumbernum_digits )

    number: (Decimal) The number to be rounded.

    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.

     For e.g.
     

    roundup(7.36819) returns 7.37

    roundup(7.36819, 3) returns 7.369

    roundup(7.36819, 4) returns 7.3682

Reply
  • 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

    x Floor X Ceiling X  
    2 2 2  
    2.4 2 3  
    2.9 2 3  
    −2.7 −3 −2  
    −2 −2 −2  

    Rounddown()

    And Rounddown() rounds the number down to the specified digit. 

    rounddownnumber, [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.

     For e.g.

    rounddown(7.36819) returns 7.36

    rounddown(7.36819, 3) returns 7.368

    rounddown(7.36879, 3) returns 7.368

    rounddown(7.36819, 4) returns 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.

    roundupnumbernum_digits )

    number: (Decimal) The number to be rounded.

    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.

     For e.g.
     

    roundup(7.36819) returns 7.37

    roundup(7.36819, 3) returns 7.369

    roundup(7.36819, 4) returns 7.3682

Children
No Data