Closed rsivek closed 6 years ago
Let me know if that looks incorrect though.
The capitalization of the abbreviation (Wikipedia suggests mmHg) and using the LL
suffix for the literals of the std::ratio
which might overflow an int
.
@johelegp Both excellent points, thank you. I've updated the request above with your suggested changes.
Adding it won't be a problem. That conversion factor is rough though, and this unit is going to overflow like crazy if you do anything very complicated with it. As a practical matter, it may be better to approximate mmHg
with Torr
.
@nholthaus that's a good point. A close approximation in terms of torrs
would be 6178355 : 6178354.
The difference between the two units is so small that I don't think we could effectively reduce the ratio values below that without making them 1 : 1.
added to the latest 3.x. I used the original (official) definition because as a design principle no approximations are used in the library.
First off, this library is awesome! Thank you for making this available.
I would like to see mmhg (millimeters of mercury) for units of pressure, which is "precisely 133.322387415 pascals".
I believe this would be defined as follows in the
pressure
namespace:UNIT_ADD(pressure, mmhg, mmhg, mmHg, unit<std::ratio<26664477483LL, 200000000LL>, pascals>)
Let me know if that looks incorrect though.