num-complex icon indicating copy to clipboard operation
num-complex copied to clipboard

Incorrect formatting of -0

Open d0sboots opened this issue 9 months ago • 0 comments

In various circumstances, -0 has an extra plus sign appended where it should not:

use num::complex::Complex;

fn main() {
    println!("{}", Complex::new(-0.0, -0.0));
    println!("{:+}", Complex::new(-0.0, -0.0));
}
-0+-0i
+-0+-0i

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=c5368ca99596e43a2f3a59e7762e396c

d0sboots avatar Mar 02 '25 02:03 d0sboots