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
207 stars 122 forks source link

Different kinds of 'number' #531

Open christianp opened 6 years ago

christianp commented 6 years ago

The number data type is a straightforward IEEE float at the moment. This is an easy solution that covers most kinds of number, but means authors need to understand all the edge cases or implement non-standard operations on top of floating point arithmetic.

It would be nice if we could add more number-like data types, so that the right behaviour happens automatically.

Examples of number-like types:

christianp commented 3 years ago

I learnt a good word recently: 'torsor'. The nLab says a torsor is "roughly speaking, a group that has forgotten its identity element". There's a slightly more understandable essay by John Baez.

Temperatures are examples of torsors: they can be compared, but there's no meaningful zero.