File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 55from detail .decode_decimal32 import decode_decimal32
66from detail .decode_decimal64 import decode_decimal64
77from detail .decode_decimal128 import decode_decimal128
8+ from detail .decode_fast_type import decode_fast_type
89import lldb
910
1011def decimal32_summary (valobj , internal_dict ):
Original file line number Diff line number Diff line change 1+ # Copyright 2025 Matt Borland
2+ # Distributed under the Boost Software License, Version 1.0.
3+ # https://www.boost.org/LICENSE_1_0.txt
4+
5+ from generate_string import generate_string
6+
7+ def decode_fast_type (significand , exp , sign ):
8+ return generate_string (significand , exp , sign )
9+
Original file line number Diff line number Diff line change 1+ # Copyright 2025 Matt Borland
2+ # Distributed under the Boost Software License, Version 1.0.
3+ # https://www.boost.org/LICENSE_1_0.txt
4+
5+ def generate_string (significand , exp , sign ):
6+ if significand == 0 :
7+ result = "0.0e+0"
8+ else :
9+ sig_str = str (significand )
10+ n_digits = len (sig_str )
11+ if n_digits == 1 :
12+ normalized_str = sig_str
13+ total_exp = exp
14+ else :
15+ normalized_str = sig_str [0 ] + '.' + sig_str [1 :]
16+ total_exp = exp + n_digits - 1
17+ result = f"{ '-' if sign else '' } { normalized_str } e{ total_exp :+} "
18+
19+ return result
You can’t perform that action at this time.
0 commit comments