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

NaN < 0 errors #644

Closed
rben01 opened this issue Nov 1, 2024 · 3 comments · Fixed by #647
Closed

NaN < 0 errors #644

rben01 opened this issue Nov 1, 2024 · 3 comments · Fixed by #647
Labels
bug Something isn't working

Comments

@rben01
Copy link
Contributor

rben01 commented Nov 1, 2024

I would expect that NaN < 0 be false, but instead it gives

>>> NaN < 0.0
error: runtime error
 = Conversion error: unit '' can not be converted to ''
@rben01
Copy link
Contributor Author

rben01 commented Nov 3, 2024

Is this due to f64::partial_cmp returning None despite all scalars being units-compatible?

numbat/numbat/src/vm.rs

Lines 755 to 759 in f064611

op @ (Op::LessThan | Op::GreaterThan | Op::LessOrEqual | Op::GreatorOrEqual) => {
let rhs = self.pop_quantity();
let lhs = self.pop_quantity();
let result = lhs.partial_cmp(&rhs).ok_or_else(|| {

@sharkdp sharkdp added the bug Something isn't working label Nov 3, 2024
@sharkdp
Copy link
Owner

sharkdp commented Nov 3, 2024

Thank you for reporting this.

@sharkdp
Copy link
Owner

sharkdp commented Jan 1, 2025

Fixed in v1.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants