You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In various circumstances, including with iterators such as below, you're holding a reference and would like to perform arithmetic.
let velocity = [Velocity::meters_per_second(5.0);3];let energy = 0.5* velocity.iter().map(|v| v * v).sum::<SpecificEnergy>();
This works in Diman if one writes the closure as |v| *v * *v, but the above works with nondimensional types and is less visually noisy. Should arithmetic (Add, Sub, Mul, Div) be implemented for all four combinations in which one or both of the args are references?
Yes, this case also works with |v| v.powi::<2>().
The text was updated successfully, but these errors were encountered:
In various circumstances, including with iterators such as below, you're holding a reference and would like to perform arithmetic.
This works in Diman if one writes the closure as
|v| *v * *v
, but the above works with nondimensional types and is less visually noisy. Should arithmetic (Add
,Sub
,Mul
,Div
) be implemented for all four combinations in which one or both of the args are references?Yes, this case also works with
|v| v.powi::<2>()
.The text was updated successfully, but these errors were encountered: