Skip to content

Fix engineering notation for zero and imaginary values - #190

Merged
PaddiM8 merged 2 commits into
PaddiM8:masterfrom
Caetanoag:fix-eng-mode-zero-handling
Sep 13, 2026
Merged

PaddiM8 merged 2 commits into
PaddiM8:masterfrom
Caetanoag:fix-eng-mode-zero-handling

Conversation

@Caetanoag

Copy link
Copy Markdown
Contributor

Zero overflowed because log10(0) = -inf cast to i32 produced NaN×10^-2147483646. Added guard rails in to_scientific_notation and ScientificNotation::Display.

Zero overflowed because log10(0) = -inf cast to i32 produced NaN×10^-2147483646. Added guard rails in to_scientific_notation and ScientificNotation::Display.
The error was using self.value == 1f64 instead of self.value != 1f64

@PaddiM8 PaddiM8 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@PaddiM8
PaddiM8 merged commit d1e9198 into PaddiM8:master Sep 13, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants