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
202 stars 117 forks source link

mod(a,b) should always return a positive number #257

Closed christianp closed 11 years ago

christianp commented 11 years ago

Currently, mod(a,b) follows javascript and returns a negative number for negative a, i.e. mod(-5,9) = -5. I think we should always return a positive number, because that's the convention in maths. What do you think?

BillFoster commented 11 years ago

Yes - please change - I wasn't aware of this!


From: Christian Perfect [notifications@github.com] Sent: 20 February 2013 16:21 To: numbas/Numbas Subject: [Numbas] mod(a,b) should always return a positive number (#257)

Currently, mod(a,b) follows javascript and returns a negative number for negative a, i.e. mod(-5,9) = -5. I think we should always return a positive number, because that's the convention in maths. What do you think?

— Reply to this email directly or view it on GitHubhttps://github.com/numbas/Numbas/issues/257.