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

Add support for simba #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nullchinchilla
Copy link

No description provided.

Copy link
Owner

@ajtribick ajtribick left a 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"]
Copy link
Owner

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()
Copy link
Owner

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)
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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!()
Copy link
Owner

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.

@nullchinchilla
Copy link
Author

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.

@ajtribick
Copy link
Owner

Apologies for the delay on this, will take another look after I do the 0.7 release.

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

Successfully merging this pull request may close these issues.

2 participants