We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 706179f commit ecd7094Copy full SHA for ecd7094
vlib/strings/builder.c.v
@@ -81,7 +81,7 @@ pub fn (mut b Builder) write_decimal(n i64) {
81
return
82
}
83
mut buf := [25]u8{}
84
- mut x := if n < 0 { -n } else { n }
+ mut x := if n < 0 { u64(-n) } else { u64(n) }
85
mut i := 24
86
for x != 0 {
87
nextx := x / 10
vlib/strings/builder_test.v
@@ -165,6 +165,7 @@ fn test_write_decimal() {
165
assert sb_i64_str(-1234567890) == '-1234567890'
166
assert sb_i64_str(9223372036854775807) == '9223372036854775807'
167
assert sb_i64_str(-9223372036854775807) == '-9223372036854775807'
168
+ assert sb_i64_str(min_i64) == '-9223372036854775808'
169
170
171
fn test_grow_len() {
0 commit comments