Comments (4)
This would possibly be handled by #91, but I'm going to leave open as a separate request for the time being.
from uom.
Back in 2019 I had big plans to solidify the current uom
into a 1.0 release. Based on current limitations (#91) I had also started working through a new API that would eventually become 2.0. You can see my efforts in the dev-macros
branch (I was also looking at moving to procedural macros). One of things the new API does do is make Dimension
and associated type of Unit
.
Lines 272 to 275 in 020e421
Besides being really busy, part of the reason I haven't made progress is that the limitation of what is in that branch is that the output type needs to be specified for any multiply or divide operations. I'm also not sure if procedural macros is the appropriate way forward or if some kind of pre-compile codegen is more appropriate.
from uom.
Not sure I understand. I tried writing my own similar library that carried a unit along with each value, but ran into a similar limitation. There is no way to know at compile time that kilometer
divided by hour
makes the unit type kilometer_per_hour
. But the way uom works, multiply/divide just works on base units, right? At least D
is just computed from the inputs; I don't know what K
is in the above snippet.
from uom.
Yes, uom
normalizes values down to the 7 base units (defaults can be overridden by ISQ!
). K
distinguishes the quantity's kind. A notable example is thermodynamic temperature/temperature interval (ratio/angle is another example). Both quantities have the same dimension but different kinds and you don't want to mistakenly add the two together.
Lines 22 to 44 in 7c4b27b
from uom.
Related Issues (20)
- Unable to `clamp` quantity to a range. HOT 2
- Unexpected inequality with large conversion factor HOT 6
- Allow subtracting two thermodynamic temperatures HOT 3
- Deserialize references to quantities HOT 2
- New unit `ElectricalSusceptance` HOT 1
- Change of base_unit of Ratio quantity HOT 1
- Conversion to/from complex storage types is wrong
- Quantity-Aware access parts of quantity with complex storage type HOT 2
- Consider rust-specific cache action HOT 1
- Built-In SI system has no alias for Angular Momentum
- Unit conversion problem using BigRational
- Unclear about how to create arbitrary quantities with arbitrary units HOT 6
- Conversion to Watts HOT 1
- Newbie Feedback HOT 1
- New release HOT 1
- NIST Special Publication link
- Add a feature for bytemuck and/or zerocopy to `Quantity`
- Support fixed-point storage type(s)
- Better precision and abbreviation change for `astronomical_unit` HOT 6
- Implement clamp for f64 Quantities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uom.