Commit a5e901b
committed
Fix the conversion process from an integer to an octal string
The implementation of __str_base8() produces incorrect
conversions when handling negative integers.
For example, a 32-bit negative integer '0xfffff204', it will
produce '7' at the most significant digit due to sign extension.
However, it should produce '3' by using the leftmost 2 bits only.
Therefore, this commit modifies the conversion process to fix
the mentioned problem.1 parent c2e0383 commit a5e901b
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
0 commit comments