Skip to content

Incorrect formatting of -0 #138

Description

@d0sboots

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions