Question: he floor ( ) function rounds a number to the nearest integer toward minus infinity. You want to instead round any given number toward zero
he floor function rounds a number to the nearest integer toward minus infinity. You want
to instead round any given number toward zero effectively clipping all values after the decimal
point, such that rounds to while rounds to instead of To do this, in this
problem you must nest some combination of the builtin functions floor abs and sign
Note that abs returns the absolute value of a number, and sign returns the sign of a number
for positive and for negative For example, sign returns a value of and
sign returns Using this knowledge, write lines of code that will do the following:
Line : Assign a value of to a variable called var
ENMEENAE University of Maryland
Line : Assign a value of to a variable called var
Line : Construct a single statement to round var toward zero and display the result Assign
the value to var
Line : Repeat line for var Assign to var
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
