Skip to content

Conversation

@blob1807
Copy link
Contributor

@blob1807 blob1807 commented Dec 15, 2025

Fixes #6018 by wrapping the abs in a cast. As by itself abs(min(T)) == min(T). This also mirrors how core:strconv does it.
See linked issue for more information.

This PR also does some minor formatting to print_u64 to keep it consistent with print_i64.

@blob1807 blob1807 changed the title [base:runtime] fix print_i64 uses an OOB index when min(i64) is given. [base:runtime] fix print_i64 using an OOB index when min(i64) is given. Dec 15, 2025
Comment on lines +187 to +188
b :: u64(10)
u := x
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this was changed too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As already stated, To a have consistent look between the two is all. There's no reason beyond that.
I do understand random formatting changes are weird to do. So I can revert it if you wish.

@laytan laytan merged commit 40267e3 into odin-lang:master Dec 20, 2025
8 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.

[base:runtime]: print_i64 uses an OOB index when min(i64) is given.

3 participants