diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd583c4..66d2f65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,15 @@ Deprecated API's * `From` for `Result>` is deprecated so it will no longer be possible to do `EvalAltResult::ErrorXXXXX.into()` to convert to a `Result`; instead, `Err(EvalAltResult:ErrorXXXXX.into())` must be used. Code is clearer if errors are explicitly wrapped in `Err`. +Version 1.1.3 +============= + +Bug fixes +--------- + +* Printing of integral floating-point numbers is fixed (used to only prints `0.0`). + + Version 1.1.2 ============= diff --git a/src/ast.rs b/src/ast.rs index 18aa6b7b..2b2ec678 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1832,7 +1832,7 @@ impl fmt::Debug for FloatWrapper { impl> fmt::Display for FloatWrapper { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let abs = self.0.abs(); - if abs.fract().is_zero() { + if abs.is_zero() { f.write_str("0.0") } else if abs > Self::MAX_NATURAL_FLOAT_FOR_DISPLAY.into() || abs < Self::MIN_NATURAL_FLOAT_FOR_DISPLAY.into()