mathsteps: figure out what to do about errors from rounding midway through

Blocked on a new parse tree that Kevin is working on. When we have the new tree, we’ll be able to add clearer information about approximate values and won’t have to round!


so it’s good pedagogically to round partway through, but then we can get the wrong answer in the end!

e.g. this gives us 6.399 when it should actually be 6.4 😦

x - 3.4 = ( x - 2.5)/( 1.3)

steps (approximately, to give an idea of why this happens):

  • x - 3.4 = x/1.3 - 2.5/1.3
  • x - 3.4 = x/1.3 - 1.9231 (maybe we wouldn’t divide here, but how would we make that call easily?)
  • (1 - 1/1.3) x = 3.4 - 1.9231
  • 0.2308x = 1.4769
  • x = 6.399

I’m not really sure what the best pedagogical solution is! having really long numbers in the middle wouldn’t really be great. What would we want to show the user?

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

After doing some digging it turns out math.js’ bignum is arbitrary precision math and doesn’t use fractions. Thankfully, math.js also as a fraction library. I’m going to give that a try instead.