Skip to content

Commit 0d08900

Browse files
committed
Preserve cohort
1 parent 8ffda03 commit 0d08900

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/debugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main()
1414

1515
const decimal32_t max {std::numeric_limits<decimal32_t>::max()};
1616
const decimal32_t min {std::numeric_limits<decimal32_t>::min()};
17-
const decimal32_t short_num {"3.14"};
17+
const decimal32_t short_num {"3.140"};
1818
const decimal32_t pos_inf {std::numeric_limits<decimal32_t>::infinity()};
1919
const decimal32_t neg_inf {-std::numeric_limits<decimal32_t>::infinity()};
2020

extra/decimal_printer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def decimal32_summary(valobj, internal_dict):
1313
bits = val.GetChildMemberWithName("bits_").GetValueAsUnsigned()
1414

1515
sign = bits & 2147483648 != 0
16+
isnan = False
17+
1618
if bits & 2013265920 == 2013265920:
1719

1820
if bits & 2113929216 == 2113929216:
@@ -30,7 +32,7 @@ def decimal32_summary(valobj, internal_dict):
3032
payload = bits & 8388607
3133
if payload > 0:
3234
result += '(' + str(payload) + ')'
33-
35+
3436
else:
3537
# See decimal32_t::to_components()
3638
d32_comb_11_mask = 1610612736
@@ -56,7 +58,7 @@ def decimal32_summary(valobj, internal_dict):
5658
else:
5759
normalized = significand
5860
total_exp = exp
59-
result = f"{'-' if not sign else ''}{normalized}e{total_exp:+}"
61+
result = f"{'-' if sign else ''}{normalized:.{n_digits - 1}f}e{total_exp:+}"
6062

6163
return result
6264
except Exception as e:

0 commit comments

Comments
 (0)