Skip to content
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

Support for right hand side operations and division #105

Open
exor2008 opened this issue Feb 2, 2024 · 1 comment
Open

Support for right hand side operations and division #105

exor2008 opened this issue Feb 2, 2024 · 1 comment

Comments

@exor2008
Copy link

exor2008 commented Feb 2, 2024

let v = F32x3::from((1.0, 2.0, 3.0));

v * 2.0; // Supported
2.0 * v; // Not supported
1.0 / v; // Not supported
v / 10.0; // Not supported

May be also element-wise multiplication and division for vectors.

let v = F32x3::from((1.0, 2.0, 3.0));
let w = F32x3::from((3.0, 2.0, 1.0));

v.mult(w); // v*w -> cross product
v / w;

Can do PR if needed

@sunsided
Copy link
Contributor

Sadly that doesn't work as of now due to Rust's coherence rules. It ends up in a classy

type parameter `C` must be covered by another type when it appears before the first local type (`Vector3d<C>`)

I'm assuming the problem might be solvable when trait specialization / default impl lands. Alternatively, one could specialize for the standard numeric types but in general, this simply cannot be implemented at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants