Skip to content

Conversation

@mhauru
Copy link
Contributor

@mhauru mhauru commented Nov 21, 2025

Closes #921

There's still this case, where the formatter changes the value of the expression:

julia> format_text("0x1p1.2")
"0x1p10.2"

julia> 0x1p1.2
0.4

julia> 0x1p10.2
204.8

However, I think 0x1p1.2 should be a syntax error, so maybe not worth fixing? I've reported it as a Julia bug here JuliaLang/julia#60189. To be clear, what happens there is that Julia parses 0x1p1.2 as a juxtaposition of 0x1p1 and .2, i.e. a multiplication. The formatter then expands the .2 to be 0.2, which results in 0x1p10.2, changing the value of the first literal that is being multiplied.

@domluna
Copy link
Owner

domluna commented Nov 22, 2025

lgtm anything else before merging?

@mhauru
Copy link
Contributor Author

mhauru commented Nov 24, 2025

Not from my side, happy to merge.

@mhauru
Copy link
Contributor Author

mhauru commented Nov 24, 2025

Also, the Julia issue I described in the OP got fixed already: JuliaLang/julia#60199

@domluna domluna merged commit 8e1d02a into domluna:master Nov 25, 2025
12 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.

Formatting float point change its value

2 participants