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

assertion failed: !nan.is_sign_positive() && !nan.is_sign_negative() #312

Closed
cuviper opened this issue Jun 29, 2017 · 2 comments
Closed

Comments

@cuviper
Copy link
Member

cuviper commented Jun 29, 2017

The standard library has changed behavior: issue rust-lang/rust#42425, pr rust-lang/rust#42431

This breaks our tests on nightly:

---- src/float.rs - float::Float::is_sign_positive (line 329) stdout ----
	thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'assertion failed: !nan.is_sign_positive() && !nan.is_sign_negative()', <anon>:14
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', /checkout/src/librustdoc/test.rs:318
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- src/float.rs - float::Float::is_sign_negative (line 348) stdout ----
	thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'assertion failed: !nan.is_sign_positive() && !nan.is_sign_negative()', <anon>:14
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', /checkout/src/librustdoc/test.rs:318


failures:
    src/float.rs - float::Float::is_sign_negative (line 348)
    src/float.rs - float::Float::is_sign_positive (line 329)

I think we'll have to drop our own expectations about NaN here, and just let it follow whatever std does, whether old or new. We also have our own implementations for no_std on the next branch, which should probably follow the new behavior.

@PlasmaPower
Copy link
Contributor

I'm working on this.

@cuviper cuviper mentioned this issue Jul 9, 2017
bors bot added a commit that referenced this issue Jul 10, 2017
315: Fix float NaN positive/negative assumptions r=cuviper

These are the minimal assumptions to make about `NaN`. Fixes part of #312 (but not the `next` branch).
@cuviper
Copy link
Member Author

cuviper commented Sep 22, 2017

This is fixed on both master and next now.

@cuviper cuviper closed this as completed Sep 22, 2017
bors bot added a commit to rust-num/num-traits that referenced this issue Mar 1, 2018
41: Various improvements to FloatCore r=vks a=cuviper

- New macros simplify forwarding method implementations.
  - `Float` and `Real` use this to compact their implementations.
  - `FloatCore` now forwards `std` implementations when possible.
- `FloatCore` now requires `NumCast`, like `Float does.
- New additions to `FloatCore`:
  - Constants like `min_value()` -> `f64::MIN`
  - Rounding methods `floor`, `ceil`, `round`, `trunc`, `fract`
  - `integer_decode` matching `Float`'s
- Fix NAN sign handling in `FloatCore` (rust-num/num#312, rust-lang/rust#42425)
- Fix overflow in `FloatCore::powi` exponent negation.
- Add doctests to all `FloatCore` methods.
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