Skip to content
Myr

Merge branch 'fix_ub_shift' of https://github.com/wojdyr/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents cb9d4e9, 3366d1e · Browse files · 2 files+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−1 removed

  • tests:+1 added−0 removed
  • other:+1 added−1 removed

2 files+2 added−1 removed

modified:tests/test_sprintf.c+1 added
83 unmodified lines
84 CHECK2(" 0", "% .0f", 0.1);85 CHECK2("0.00", "%.2f", 1e-4);86 CHECK2("-5.20", "%+4.2f", -5.2);87 CHECK2("0.0 ", "%-10.1f", 0.);88 CHECK2("-0.000000", "%f", -0.);89 CHECK2("0.000001", "%f", 9.09834e-07);90#if USE_STB // rounding differences91 CHECK2("38685626227668133600000000.0", "%.1f", pow_2_85);92 CHECK2("0.000000499999999999999978", "%.24f", 5e-7);
112 unmodified lines
modified:stb_sprintf.h+1 added-1 removed
1696 unmodified lines
1697 }16981699 if (expo == 0) // is zero or denormal1700 {1701 if ((bits << 1) == 0) // do zero1701 if (((stbsp__uint64) bits << 1) == 0) // do zero1702 {1703 *decimal_pos = 1;1704 *start = out;1705 out[0] = '0';
174 unmodified lines