Comments (1)
Rust does it internally for all the NonZero
types using
#[rustc_layout_scalar_valid_range_start(1)]
There is also rustc_layout_scalar_valid_range_end()
. However these can only be used internally (or maybe on nightly).
So the only way to do it on stable is to use NonZero
and add setters/getters that convert the niche value to 0. That's how nonmax works (see this code).
Obviously that has performance implications.
It looks like there is ongoing work on this sort of thing in Rust.
from decorum.
Related Issues (20)
- Serialization of proxy types does not encode the proxy type, only the inner type. HOT 3
- Consider expanding the scope of Decorum or creating related crates. HOT 1
- Consider allowing for different orderings (with some reasonable default). HOT 2
- Zero values are not handled consistently. HOT 1
- Improve testing. HOT 1
- Integrate with num-traits 0.2.*. HOT 3
- Possible to assign NaN to a NotNan value using sqrt(-1) HOT 1
- Errors for initializing a NotNan value with NaN use .unwrap() instead of .expect(...) HOT 1
- Implement the Sum and Product trait HOT 2
- Point of the std feature HOT 3
- Is there a way to create custom constraints? HOT 2
- Implement field and other numeric traits from alga. HOT 4
- Ability to define const values HOT 1
- R64 does not satisfy nalgebra::Real HOT 2
- Improve `Debug` implementation HOT 1
- Use more precise names for associated constants of the `Encoding` trait. HOT 3
- Implement `ToCanonicalBits` for all proxy types. HOT 1
- Cycle detected when const-evaluating NAN HOT 2
- Implement custom de/serialization for non-real floating-point values. 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 decorum.