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

Cmplx division by 0 and NaN #5736

Closed
huonw opened this issue Apr 5, 2013 · 9 comments
Closed

Cmplx division by 0 and NaN #5736

huonw opened this issue Apr 5, 2013 · 9 comments

Comments

@huonw
Copy link
Member

huonw commented Apr 5, 2013

Should 1/(0+0i) be NaN+NaN i or fail, or something else.

see also #1284

@catamorphism
Copy link
Contributor

Nominating for milestone 2, backwards-compatible

@catamorphism
Copy link
Contributor

Visiting for triage.

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

Worth implementing correctly, but if anyone depends on its present behavior they're depending on a bug.

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

(also in libextra, not slated for 1.0-timeline stability commitment)

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

just a bug, removing milestone/nomination.

@treeman
Copy link
Contributor

treeman commented Aug 13, 2014

No longer relevant.

Explicit test for failure message with #16475.

@treeman
Copy link
Contributor

treeman commented Aug 14, 2014

My mistake. Still relevant.

For Complex32 and Complex64 still outputs -NaN+-NaNi. Testcase:

extern crate num;
use num::complex::{Complex32, Complex64, Complex};

fn main() {
    let _0_0i: Complex64 = Complex { re: 0.0, im: 0.0 };
    let _1_0i: Complex64 = Complex { re: 1.0, im: 0.0 };

    println!("{}", _1_0i / _0_0i);
}

While Complex<int> fails.

Do we want NaN+NaN i or do we want it to fail?

@gifnksm
Copy link
Contributor

gifnksm commented Nov 2, 2014

libnum crate moved to rust-lang/num repository.
@nick29581 Could you clone this issue to num repository?

@rust-highfive
Copy link
Collaborator

This issue has been moved to the RFCs repo: rust-num/num#20

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

7 participants