-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for simba #25
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, spotted a few issues but I agree that being able to support nalgebra would be a good thing to have.
@@ -21,19 +21,21 @@ name = "twofloat" | |||
test = true | |||
|
|||
[features] | |||
default = ["std", "math_funcs"] | |||
default = ["std", "math_funcs", "simba"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to leave this as an optional additional feature
} | ||
|
||
fn pi() -> Self { | ||
f64::pi().into() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the similar methods should use the constants defined in TwoFloat::consts
return false; | ||
} | ||
|
||
self.hi().ulps_eq(&other.hi(), epsilon.into(), max_ulps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look correct - if self.hi
is normal, then ulps would be determined by self.lo
. If self.hi
is subnormal or zero, then self.lo
would be zero and the ulps would be determined by the value of self.hi
.
} | ||
|
||
fn extract(&self, _: usize) -> Self::Element { | ||
*self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the contract, this should panic if i >= self.lanes()
} | ||
|
||
fn replace(&mut self, _: usize, val: Self::Element) { | ||
*self = val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the contact, this should panic if i >= self.lanes()
} | ||
|
||
fn cbrt(self) -> Self { | ||
todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should call the cbrt
function on the TwoFloat
struct.
Thanks for all the comments! Would it be possible for you to edit the code and merge it in? I'm honestly quite unfamiliar with the whole low-level ecosystem surrounding num_traits, simba, and such. |
Apologies for the delay on this, will take another look after I do the 0.7 release. |
No description provided.