Skip to content

TM::String::format and hex values formatted as float#2858

Merged
herwinw merged 3 commits into
natalie-lang:masterfrom
herwinw:tm_string_format_hex_float
Dec 19, 2025
Merged

TM::String::format and hex values formatted as float#2858
herwinw merged 3 commits into
natalie-lang:masterfrom
herwinw:tm_string_format_hex_float

Conversation

@herwinw
Copy link
Copy Markdown
Member

@herwinw herwinw commented Dec 19, 2025

A few fixes for TM::String::format I found while I was trying to get #2853 to work. I've split these off, and will fix that other case once this is merge.

A bit of a cleanup (use the c++14 std::is_pointer_v<T> and similar instead of std::is_pointer<T>::value), and don't allow hex printing of floats (these were converted to ints, so the output is not what you would expect, you can still cast them to int manually if you really need the old behaviour).

This test shows the actual behaviour of a float, which should not be truncated
silently. Fix this to thrown an error.
Floats should not be silently converted into ints.
Use the _v versions instead of suffixing it with ::value.
@herwinw herwinw changed the title Tm string format hex float TM::String::format and hex values formatted as float Dec 19, 2025
@herwinw herwinw merged commit df63998 into natalie-lang:master Dec 19, 2025
47 of 50 checks passed
@herwinw herwinw deleted the tm_string_format_hex_float branch December 19, 2025 18:13
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.

2 participants