Skip to content

Conversation

@bicycle1885
Copy link
Member

I discovered that Ryu.writefixed with trimtrailingzeros = true (the last argument) does not trim trailing zeros if the given value is zero:

julia> Ryu.writefixed(0.0, 1, false, false, false, UInt8('.'), true)
"0.0"

julia> Ryu.writefixed(1.0, 1, false, false, false, UInt8('.'), true)
"1"

julia> Ryu.writefixed(2.0, 1, false, false, false, UInt8('.'), true)
"2"

There may be a reason for this behavior, but I think it is inconsistent. This PR fixes that.

@quinnj
Copy link
Member

quinnj commented May 3, 2021

Hmmm, the linux64/macos64 builds are failing because working directory is dirty? Something about some SuiteSparse files? Anyone know what's going on w/ that? cc: @staticfloat @ViralBShah

@ViralBShah
Copy link
Member

ViralBShah commented May 3, 2021

@IanButterworth did this in #40688. Maybe just rebase to master?

@bicycle1885
Copy link
Member Author

Rebased. Now it's fine.

@KristofferC KristofferC merged commit ff213c1 into JuliaLang:master May 4, 2021
@bicycle1885 bicycle1885 deleted the ryu-zero branch May 4, 2021 21:02
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
* fix consistency of trimtrailingzeros (Ryu)
dghosef pushed a commit to dghosef/julia that referenced this pull request May 11, 2021
* fix consistency of trimtrailingzeros (Ryu)
@bicycle1885 bicycle1885 added the backport 1.6 Change should be backported to release-1.6 label May 11, 2021
KristofferC pushed a commit that referenced this pull request May 11, 2021
* fix consistency of trimtrailingzeros (Ryu)

(cherry picked from commit ff213c1)
@KristofferC KristofferC mentioned this pull request May 11, 2021
45 tasks
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
* fix consistency of trimtrailingzeros (Ryu)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jul 12, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
* fix consistency of trimtrailingzeros (Ryu)

(cherry picked from commit ff213c1)
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.

4 participants