And also treat inf and nan as quantities that can have arbitrary units