v / vlib / math / big / big.v
40 lines · 37 sloc · 1.05 KB · aca3797f2371868e354abb68edc641e6210df9ce
Raw
1module big
2
3pub const zero_int = Integer{
4 digits: []u64{len: 0}
5 signum: 0
6 is_const: true
7}
8pub const one_int = positive_integer(1)
9pub const two_int = positive_integer(2)
10pub const three_int = positive_integer(3)
11
12pub const c0 = zero_int
13pub const c1 = positive_integer(1)
14pub const c2 = positive_integer(2)
15pub const c3 = positive_integer(3)
16pub const c4 = positive_integer(4)
17pub const c5 = positive_integer(5)
18pub const c6 = positive_integer(6)
19pub const c7 = positive_integer(7)
20pub const c8 = positive_integer(8)
21pub const c9 = positive_integer(9)
22pub const c10 = positive_integer(10)
23pub const c11 = positive_integer(11)
24pub const c12 = positive_integer(12)
25pub const c13 = positive_integer(13)
26pub const c14 = positive_integer(14)
27pub const c15 = positive_integer(15)
28pub const c16 = positive_integer(16)
29pub const c17 = positive_integer(17)
30pub const c18 = positive_integer(18)
31pub const c19 = positive_integer(19)
32pub const c20 = positive_integer(20)
33
34fn positive_integer(x int) Integer {
35 return Integer{
36 digits: [u64(x)]
37 signum: 1
38 is_const: true
39 }
40}
41