aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/strconv/structs.v
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/vlib/strconv/structs.v
downloadcli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'v_windows/v/vlib/strconv/structs.v')
-rw-r--r--v_windows/v/vlib/strconv/structs.v55
1 files changed, 55 insertions, 0 deletions
diff --git a/v_windows/v/vlib/strconv/structs.v b/v_windows/v/vlib/strconv/structs.v
new file mode 100644
index 0000000..35ade80
--- /dev/null
+++ b/v_windows/v/vlib/strconv/structs.v
@@ -0,0 +1,55 @@
+module strconv
+
+// The structure is filled by parser, then given to converter.
+pub struct PrepNumber {
+pub mut:
+ negative bool // 0 if positive number, 1 if negative
+ exponent int // power of 10 exponent
+ mantissa u64 // integer mantissa
+}
+
+// dec32 is a floating decimal type representing m * 10^e.
+struct Dec32 {
+mut:
+ m u32
+ e int
+}
+
+// dec64 is a floating decimal type representing m * 10^e.
+struct Dec64 {
+mut:
+ m u64
+ e int
+}
+
+struct Uint128 {
+mut:
+ lo u64
+ hi u64
+}
+
+// support union for convert f32 to u32
+union Uf32 {
+mut:
+ f f32
+ u u32
+}
+
+// support union for convert f64 to u64
+union Uf64 {
+mut:
+ f f64
+ u u64
+}
+
+pub union Float64u {
+pub mut:
+ f f64
+ u u64
+}
+
+pub union Float32u {
+pub mut:
+ f f32
+ u u32
+}