numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

Mathematical expression part: when marking a formula, replace `=` with `isclose` #1014

Closed christianp closed 10 months ago

christianp commented 1 year ago

Floating-point error can cause the two theoretically-identical expressions to be very slightly different if the operations are done in a different order.

When marking a formula of a form such as y = expression, this can cause the = operator to evaluate to false when really we'd like it to be true.

When marking a formula, the mathematical expression part's marking algorithm should replace a = b in the expresssions to be compared with isclose(a,b).