difference between floor() and rounddown() function

Certified Senior Developer

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

  Discussion posts and replies are publicly visible

Parents
  • Hello,
    floor:-The floor function functionality is to just give the number of digits which we had give after the decimal.
    for eg :- floor(2.88888, .001)== 2.888 (this function will not give the round of values only provide same digits)

    Rounddown():- this function is also to give the number fo digits after the decimal without any change in the value.
    for eg:- rounddown(2.1298,2)== 2.12 or rounddown(2.1211,2)== 2.12,

    RoundUp():- this function will give the nearest round of depend on the last digit of the value we required.
    for eg:- round(2.1298,2) or roundup(2.1218,2) == 2.13 and roundup(2.1200)= 2.12, so if the digit next to the digit we required is 0 then output will be same otherwise the value will me increaser by 1 added in the last digit.
    roundup(2.192)= 2.2

    ceiling()= This function will give the next number value and after the decimal if all the digits are 0 then the output will be the same otherwise the output will be the next number. Also you can define that it has to give add +1 or +.5 according to the value after decimal
    for eg:- ceiling(2.00)= 2, ceiling(2.01)= 3 (by default the increment value is +1)
    for eg:- ceiling(2.00,.5)=2, ceiling(2.01,.5)= 2.5,ceiling(2.50,.5)= 2.5,ceiling(2.512)= 3, ceiling(2.65)= 3

    Hope this will help you.

    Thanks
    Sahil Batra
Reply
  • Hello,
    floor:-The floor function functionality is to just give the number of digits which we had give after the decimal.
    for eg :- floor(2.88888, .001)== 2.888 (this function will not give the round of values only provide same digits)

    Rounddown():- this function is also to give the number fo digits after the decimal without any change in the value.
    for eg:- rounddown(2.1298,2)== 2.12 or rounddown(2.1211,2)== 2.12,

    RoundUp():- this function will give the nearest round of depend on the last digit of the value we required.
    for eg:- round(2.1298,2) or roundup(2.1218,2) == 2.13 and roundup(2.1200)= 2.12, so if the digit next to the digit we required is 0 then output will be same otherwise the value will me increaser by 1 added in the last digit.
    roundup(2.192)= 2.2

    ceiling()= This function will give the next number value and after the decimal if all the digits are 0 then the output will be the same otherwise the output will be the next number. Also you can define that it has to give add +1 or +.5 according to the value after decimal
    for eg:- ceiling(2.00)= 2, ceiling(2.01)= 3 (by default the increment value is +1)
    for eg:- ceiling(2.00,.5)=2, ceiling(2.01,.5)= 2.5,ceiling(2.50,.5)= 2.5,ceiling(2.512)= 3, ceiling(2.65)= 3

    Hope this will help you.

    Thanks
    Sahil Batra
Children
No Data