1 | float f_neg3 = 1.234567 / 1e3; |
2 | float f_neg4 = 1.234567 / 1e4; |
3 | float f_neg5 = 1.234567 / 1e5; |
4 | float f_neg6 = 1.234567 / 1e6; |
5 | float f_neg7 = 1.234567 / 1e7; |
6 | float f_neg8 = 1.234567 / 1e8; |
7 | float f_neg20 = 1.234567 / 1e20; |
8 | float f_neg30 = 1.234567 / 1e30; |
9 | |
10 | float f_3 = 1.234567 * 1e3; |
11 | float f_4 = 1.234567 * 1e4; |
12 | float f_5 = 1.234567 * 1e5; |
13 | float f_6 = 1.234567 * 1e6; |
14 | float f_7 = 1.234567 * 1e7; |
15 | float f_8 = 1.234567 * 1e8; |
16 | float f_20 = 1.234567 * 1e20; |
17 | float f_30 = 1.234567 * 1e30; |
18 | |
19 | double d_neg3 = 1.234567 / 1e3; |
20 | double d_neg4 = 1.234567 / 1e4; |
21 | double d_neg5 = 1.234567 / 1e5; |
22 | double d_neg6 = 1.234567 / 1e6; |
23 | double d_neg7 = 1.234567 / 1e7; |
24 | double d_neg8 = 1.234567 / 1e8; |
25 | double d_neg20 = 1.234567 / 1e20; |
26 | double d_neg30 = 1.234567 / 1e30; |
27 | double d_neg50 = 1.234567 / 1e50; |
28 | double d_neg250 = 1.234567 / 1e250; |
29 | |
30 | double d_3 = 1.234567 * 1e3; |
31 | double d_4 = 1.234567 * 1e4; |
32 | double d_5 = 1.234567 * 1e5; |
33 | double d_6 = 1.234567 * 1e6; |
34 | double d_7 = 1.234567 * 1e7; |
35 | double d_8 = 1.234567 * 1e8; |
36 | double d_20 = 1.234567 * 1e20; |
37 | double d_30 = 1.234567 * 1e30; |
38 | double d_50 = 1.234567 * 1e50; |
39 | double d_250 = 1.234567 * 1e250; |
40 | |
41 | int main (int argc, char const *argv[]) { |
42 | //% # Default setting should be 6. |
43 | //% self.expect("frame variable f_neg3", substrs=["0.00123456"]) |
44 | //% self.expect("frame variable f_neg4", substrs=["0.000123456"]) |
45 | //% self.expect("frame variable f_neg5", substrs=["0.0000123456"]) |
46 | //% self.expect("frame variable f_neg6", substrs=["0.00000123456"]) |
47 | //% self.expect("frame variable f_neg7", substrs=["1.234567", "E-7"]) |
48 | //% self.expect("frame variable f_neg8", substrs=["1.23456", "E-8"]) |
49 | //% self.expect("frame variable f_neg20", substrs=["E-20"]) |
50 | //% self.expect("frame variable f_neg30", substrs=["E-30"]) |
51 | //% self.expect("frame variable f_3", substrs=["1234.56"]) |
52 | //% self.expect("frame variable f_4", substrs=["12345.6"]) |
53 | //% self.expect("frame variable f_5", substrs=["123456"]) |
54 | //% self.expect("frame variable f_6", substrs=["123456"]) |
55 | //% self.expect("frame variable f_7", substrs=["123456"]) |
56 | //% self.expect("frame variable f_8", substrs=["123456"]) |
57 | //% self.expect("frame variable f_20", substrs=["E+20"]) |
58 | //% self.expect("frame variable f_30", substrs=["E+30"]) |
59 | //% self.expect("frame variable d_neg3", substrs=["0.00123456"]) |
60 | //% self.expect("frame variable d_neg4", substrs=["0.000123456"]) |
61 | //% self.expect("frame variable d_neg5", substrs=["0.0000123456"]) |
62 | //% self.expect("frame variable d_neg6", substrs=["0.00000123456"]) |
63 | //% self.expect("frame variable d_neg7", substrs=["1.23456", "E-7"]) |
64 | //% self.expect("frame variable d_neg8", substrs=["1.23456", "E-8"]) |
65 | //% self.expect("frame variable d_neg20", substrs=["1.23456", "E-20"]) |
66 | //% self.expect("frame variable d_neg30", substrs=["1.23456", "E-30"]) |
67 | //% self.expect("frame variable d_neg50", substrs=["1.23456", "E-50"]) |
68 | //% self.expect("frame variable d_neg250", substrs=["E-250"]) |
69 | //% self.expect("frame variable d_3", substrs=["1234.56"]) |
70 | //% self.expect("frame variable d_4", substrs=["12345.6"]) |
71 | //% self.expect("frame variable d_5", substrs=["123456"]) |
72 | //% self.expect("frame variable d_6", substrs=["1234567"]) |
73 | //% self.expect("frame variable d_7", substrs=["1234567"]) |
74 | //% self.expect("frame variable d_8", substrs=["1234567"]) |
75 | //% self.expect("frame variable d_20", substrs=["1.23456", "E+20"]) |
76 | //% self.expect("frame variable d_30", substrs=["1.23456", "E+30"]) |
77 | //% self.expect("frame variable d_50", substrs=["1.23456", "E+50"]) |
78 | //% self.expect("frame variable d_250", substrs=["1.23456", "E+250"]) |
79 | //% # Now change the setting to print all the zeroes. |
80 | //% # Note that changing this setting should invalidate the data visualizer |
81 | //% # cache so that the new setting is used in the following calls. |
82 | //% self.runCmd("settings set target.max-zero-padding-in-float-format 9999") |
83 | //% self.expect("frame variable f_neg3", substrs=["0.00123456"]) |
84 | //% self.expect("frame variable f_neg4", substrs=["0.000123456"]) |
85 | //% self.expect("frame variable f_neg5", substrs=["0.0000123456"]) |
86 | //% self.expect("frame variable f_neg6", substrs=["0.00000123456"]) |
87 | //% self.expect("frame variable f_neg7", substrs=["0.000000123456"]) |
88 | //% self.expect("frame variable f_neg8", substrs=["0.0000000123456"]) |
89 | //% self.expect("frame variable f_neg20", substrs=["0.0000000000000000000123456"]) |
90 | //% self.expect("frame variable f_neg30", substrs=["0.00000000000000000000000000000123456"]) |
91 | //% self.expect("frame variable f_3", substrs=["1234.56"]) |
92 | //% self.expect("frame variable f_4", substrs=["12345.6"]) |
93 | //% self.expect("frame variable f_5", substrs=["123456"]) |
94 | //% self.expect("frame variable f_6", substrs=["1234567"]) |
95 | //% self.expect("frame variable f_7", substrs=["1234567"]) |
96 | //% self.expect("frame variable f_8", substrs=["1234567"]) |
97 | //% self.expect("frame variable f_20", substrs=["E+20"]) |
98 | //% self.expect("frame variable f_30", substrs=["E+30"]) |
99 | //% self.expect("frame variable d_neg3", substrs=["0.00123456"]) |
100 | //% self.expect("frame variable d_neg4", substrs=["0.000123456"]) |
101 | //% self.expect("frame variable d_neg5", substrs=["0.0000123456"]) |
102 | //% self.expect("frame variable d_neg6", substrs=["0.00000123456"]) |
103 | //% self.expect("frame variable d_neg7", substrs=["0.000000123456"]) |
104 | //% self.expect("frame variable d_neg8", substrs=["0.0000000123456"]) |
105 | //% self.expect("frame variable d_neg20", substrs=["0.0000000000000000000123456"]) |
106 | //% self.expect("frame variable d_neg30", substrs=["0.000000000000000000000000000001234567"]) |
107 | //% self.expect("frame variable d_neg50", substrs=["0.0000000000000000000000000000000000000000000000000123456"]) |
108 | //% self.expect("frame variable d_neg250", substrs=["0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456"]) |
109 | //% self.expect("frame variable d_3", substrs=["1234.56"]) |
110 | //% self.expect("frame variable d_4", substrs=["12345.6"]) |
111 | //% self.expect("frame variable d_5", substrs=["123456"]) |
112 | //% self.expect("frame variable d_6", substrs=["1234567"]) |
113 | //% self.expect("frame variable d_7", substrs=["1234567"]) |
114 | //% self.expect("frame variable d_8", substrs=["1234567"]) |
115 | //% # Positive numbers are not affected by this setting. |
116 | //% self.expect("frame variable d_20", substrs=["1.23456", "E+20"]) |
117 | //% self.expect("frame variable d_30", substrs=["1.23456", "E+30"]) |
118 | //% self.expect("frame variable d_50", substrs=["1.23456", "E+50"]) |
119 | //% self.expect("frame variable d_250", substrs=["1.23456", "E+250"]) |
120 | return 0; |
121 | } |
122 | |