Tehforsch / diman

Define rust compile time unit systems using const generics
53 stars 2 forks source link

Allow expressing "one over" more conveniently in `unit_system` #11

Closed Tehforsch closed 11 months ago

Tehforsch commented 1 year ago

Currently, one has to write def InverseTime = Dimensionless / Time. It would be nicer to be able to write def InverseTime = 1.0 / Time but this doesn't work because float factors are (rightfully) not allowed in def expressions. An easy solution might be to allow parsing of the literal 1 (and only 1) as dimensionless.