1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: fix decoding most large number values (#12541)

This commit is contained in:
Larpon 2021-11-23 12:23:16 +01:00 committed by GitHub
parent 3f0e532660
commit e9efed02f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ pub fn (n Number) i64() i64 {
bin := n.text.all_after('0b').replace('_', '')
return strconv.parse_int(bin, 2, 64) or { i64(0) }
}
return strconv.parse_int(n.text, 0, 0) or { i64(0) }
return strconv.parse_int(n.text, 0, 64) or { i64(0) }
}
// f64 returns the `n Number` as an `f64` value.

View File

@ -16,7 +16,7 @@ const (
valid_value_exceptions = [
// Integer
'integer/long.toml',
'integer/long.toml', // TODO awaits BUG fix with strconv.parse_int('-9223372036854775808')
// Float
'float/inf-and-nan.toml',
// Table