Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GNU units supports normal unit conversion, such as meters to feet. These conversions all obey f(ax)=af(x), that is, if you have zero meters you have zero feet. If you want to convert something that breaks that rule then you have to give a definition in the database as a general functional form or as a lookup table. And you have to use functional syntax to perform the conversion. Some examples in the database include dB, wire gauge, shoe size, grit size for sandpaper, ring size, musical intervals, and sugar concentration. I call units defined using a lookup table or general functional form "nonlinear units".

Zero degrees Fahrenheit is of course not equal to 0 K, but conversion of absolute temperature is not presented as the best example of this class of unit conversion. It's highlighted because everybody asks about it. Temperature conversion was for years, before I figured out a way to support it elegantly, the most requested missing feature. Yes, it's a little strange to call affine transformations "nonlinear" but there is no special "affine unit" feature in the program.



Speaking of K, Celsius to K is also "nonlinear" math: you add or subtract a constant, around 272-something.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: