v / vlib / strconv
Raw file | 55 loc (47 sloc) | 719 bytes | Latest commit hash de384f1cc
1module strconv
2
3// The structure is filled by parser, then given to converter.
4pub struct PrepNumber {
5pub mut:
6 negative bool // 0 if positive number, 1 if negative
7 exponent int // power of 10 exponent
8 mantissa u64 // integer mantissa
9}
10
11// dec32 is a floating decimal type representing m * 10^e.
12struct Dec32 {
13mut:
14 m u32
15 e int
16}
17
18// dec64 is a floating decimal type representing m * 10^e.
19struct Dec64 {
20mut:
21 m u64
22 e int
23}
24
25struct Uint128 {
26mut:
27 lo u64
28 hi u64
29}
30
31// support union for convert f32 to u32
32union Uf32 {
33mut:
34 f f32
35 u u32
36}
37
38// support union for convert f64 to u64
39union Uf64 {
40mut:
41 f f64
42 u u64
43}
44
45pub union Float64u {
46pub mut:
47 f f64
48 u u64
49}
50
51pub union Float32u {
52pub mut:
53 f f32
54 u u32
55}