Comments (3)
for 1, it would need to be done in C++11 constexpr expression which could be difficult, and actually the wrapping behavior is utilized in a few cases so not sure I would want that checking in general. Something like a checked_multiply might be appropriate that wouldn't operate in constexpr and does any required checks might be appropriate.
As far as increasing the range the space requirements for many of our applications mean we didn't really consider that. I think most of the code would work fine though, Obviously have to change the unit_data class and the static asserts since they would all fail, but most other stuff should be the same. It would create some gaps in the data structures but if space isn't much of an issue that shouldn't be too big of deal. As far as a PR, I would want to be careful with it but not completely opposed. We would need to add one of the CI builds that actually used the change to make sure all the tests still passed.
from units.
Something like a checked_multiply might be appropriate that wouldn't operate in constexpr and does any required checks might be appropriate.
That sounds like a good suggestion, I'll look into it.
I think most of the code would work fine though, Obviously have to change the unit_data class and the static asserts since they would all fail, but most other stuff should be the same.
It does, I had experimented with this change yesterday and didn't encounter real issues so far. But you make a very good point about the CI and test coverage.
from units.
Fixed in #142.
from units.
Related Issues (20)
- Conan package HOT 12
- Convert to inverse unit incorrect HOT 1
- Issues with parsing single-letter prefixes such as for `atto` HOT 7
- CleanUnitString breaks on 0.2 and 0.3 HOT 1
- Strange choice of units in to_string HOT 6
- Your units conversion service seems to be down... HOT 11
- "kg m" is parsed as "kg" HOT 1
- Surprising parse results with `.` and `-` HOT 4
- Question about to_string() function HOT 8
- Format arbitrary unit nicely HOT 4
- Degrees celsius get converted to Kelvin in operations HOT 6
- Function to remove a single user defined unit HOT 2
- Try to start a PR for adding support for KPa, MPa, GPa but permission denied HOT 3
- Using to_string for scalars causes crashes HOT 2
- Use of uninitialised memory in unit maps HOT 7
- "Stress testing" units' string parsing HOT 8
- Favoring SI base units in string formatting? HOT 3
- to_string strange output HOT 4
- expression did not evaluate to a constant HOT 4
- Unary negation of measurements HOT 1
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 units.