Question

How does "ROUND_HALF_EVEN" works in python and please give some examples? Thanks.

How does "ROUND_HALF_EVEN" works in python and please give some examples? Thanks.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ROUND_HALF_EVEN is the strategy used by Python's built-in function round(). It works in a way such that the last digit of a result of rounding will always be even. Example: When 4.5 is rounded, it should give 5 but round(4.5) will result in 4 since 4 is the nearest even digit. Also round(5.5) will result in 6 as intended, since 6 is the nearest even digit. Another good example is round(0.25,1) which rounds 0.25 up to 1 decimal place and should yield 0.3, but results in 0.2 since 2 is the nearest even digit.  

Add a comment
Know the answer?
Add Answer to:
How does "ROUND_HALF_EVEN" works in python and please give some examples? Thanks.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT