-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow constants to be defined in system! or quantity! macro #32
Comments
Closed
Replying to @billyrieger in #126. I'd love to see a PR for this. If you want to start working through the open questions and put something together I'd be happy to provide assistance and review.
Based on the limited time I spent thinking through the issue while replying below is one possible solution that is pub mod constants {
storage_types! {
types: PrimInt, Float;
/// Gravitational constant.
pub const G: Quantity<uom::si::ISQ<P3, N1, N2, Z0, Z0, Z0, Z0>, uom::si::SI<f64>, f64> = Quantity { dimension: PhantomData, units: PhantomData, value: 6.674e-11 as V, };
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allow one location? Both?
Constant created by system macro (e.g.
ISQ!
) with the appropriate unit. Accessed in a submodule so there are no name collisions?let _ = uom::si::f32::velocity::c;
Constant created by system macro (e.g.
ISQ!
) with appropriate base units.let _ = uom::si::f32::G;
The text was updated successfully, but these errors were encountered: