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

strconv,js: f64_to_str works on JS backend now; Fix BigInt usage in infix expressions (#12464)

This commit is contained in:
playX
2021-11-15 15:13:44 +03:00
committed by GitHub
parent 1d2b16dde2
commit a8a1e9381f
7 changed files with 399 additions and 66 deletions

37
vlib/strconv/f64_str.v Normal file
View File

@@ -0,0 +1,37 @@
module strconv
// pow of ten table used by n_digit reduction
const (
ten_pow_table_64 = [
u64(1),
u64(10),
u64(100),
u64(1000),
u64(10000),
u64(100000),
u64(1000000),
u64(10000000),
u64(100000000),
u64(1000000000),
u64(10000000000),
u64(100000000000),
u64(1000000000000),
u64(10000000000000),
u64(100000000000000),
u64(1000000000000000),
u64(10000000000000000),
u64(100000000000000000),
u64(1000000000000000000),
u64(10000000000000000000),
]
)
//=============================================================================
// Conversion Functions
//=============================================================================
const (
mantbits64 = u32(52)
expbits64 = u32(11)
bias64 = 1023 // f64 exponent bias
maxexp64 = 2047
)