Round:
Rounds towards nearest integer
COMMANDS:
the output of round(2.3) is 2 because the nearest integer for 2.3 is 2
the output of round(2.6) is 3 because the nearest integer for 2.6 is 3
Floor:
it rounds towards negitive infinity code:
floor(2.7)
the output is
output is 2 because nearest integer in the direction of negitive infinity is 2
ceil:
it round towards positive infinity code:
output is 3 because nearest integer in the direction of positive infinity is 3
fix:
rounds the number towards zero code:
fix(1.3) give s output 1 because nearest integer in the direction of zero is 1
These are 4 commands to round numbers
Rounds towards nearest integer
COMMANDS:
round(2.3)
round(2.6)the output is
the output of round(2.3) is 2 because the nearest integer for 2.3 is 2
the output of round(2.6) is 3 because the nearest integer for 2.6 is 3
Floor:
it rounds towards negitive infinity code:
floor(2.7)
the output is
output is 2 because nearest integer in the direction of negitive infinity is 2
ceil:
it round towards positive infinity code:
ceil(2.3)output is
output is 3 because nearest integer in the direction of positive infinity is 3
fix:
rounds the number towards zero code:
fix(-1.3)
fix(1.3)the output is fix(-1.3) gives output -1 because nearest integer in the direction of zero is -1
fix(1.3) give s output 1 because nearest integer in the direction of zero is 1
These are 4 commands to round numbers
No comments:
Post a Comment