A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • one year ago

On problem set #1 part 3, are there rules about when to use the round function? My code is a little different from the answer code. My answers for monthly payment match the answers, but my balance is a couple of cents off. Very annoying. Also, can anyone explain why this line of code is in the answer? # Round monthly payment up to the nearest cent monthly_payment = round(monthly_payment + 0.004999, 2) I don't know why they have to recalculate the balance after they do this. Any help would be appreciated. Thanks.

  • This Question is Open
  1. e.mccormick
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Rounding errors in floating point numbers are a common issue. Which whey they go is to some extent machine dependent. This has to do with memory structures and how decimals, as opposed to whole numbers, get converted to and from binary.

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.