Skip to content

Commit 646d2fb

Browse files
authored
Merge pull request #123 from xushiwei/q
mv gop builtin packages => qiniu/x
2 parents 3370e74 + a56eba8 commit 646d2fb

File tree

7 files changed

+2773
-0
lines changed

7 files changed

+2773
-0
lines changed

gop/ng/_big.gop

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
Copyright 2021 The GoPlus Authors (goplus.org)
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
// +build ignore
15+
16+
package _
17+
18+
import (
19+
"math/big"
20+
)
21+
22+
// -----------------------------------------------------------------------------
23+
// type bigint
24+
25+
// A bigint represents a signed multi-precision integer.
26+
// The zero value for a bigint represents nil.
27+
type bigint struct {
28+
*big.Int
29+
}
30+
31+
func (a bigint) + (b bigint) bigint
32+
func (a bigint) - (b bigint) bigint
33+
func (a bigint) * (b bigint) bigint
34+
func (a bigint) / (b bigint) bigint
35+
func (a bigint) % (b bigint) bigint
36+
37+
func (a bigint) | (b bigint) bigint
38+
func (a bigint) ^ (b bigint) bigint
39+
func (a bigint) & (b bigint) bigint
40+
func (a bigint) &^ (b bigint) bigint
41+
42+
func (a bigint) << (n untyped_uint) bigint
43+
func (a bigint) >> (n untyped_uint) bigint
44+
func (a bigint) < (b bigint) bool
45+
func (a bigint) <= (b bigint) bool
46+
func (a bigint) > (b bigint) bool
47+
func (a bigint) >= (b bigint) bool
48+
func (a bigint) == (b bigint) bool
49+
func (a bigint) != (b bigint) bool
50+
51+
func -(a bigint) bigint
52+
func ^(a bigint) bigint
53+
54+
func ++(a bigint)
55+
func --(a bigint)
56+
57+
func (a bigint) = (b bigint)
58+
func (a bigint) += (b bigint)
59+
func (a bigint) -= (b bigint)
60+
func (a bigint) *= (b bigint)
61+
func (a bigint) /= (b bigint)
62+
func (a bigint) %= (b bigint)
63+
64+
func (a bigint) |= (b bigint)
65+
func (a bigint) ^= (b bigint)
66+
func (a bigint) &= (b bigint)
67+
func (a bigint) &^= (b bigint)
68+
69+
func (a bigint) <<= (n untyped_uint)
70+
func (a bigint) >>= (n untyped_uint)
71+
72+
func bigint() bigint
73+
func bigint(x int64) bigint
74+
75+
// -----------------------------------------------------------------------------
76+
// type bigrat
77+
78+
// A bigrat represents a quotient a/b of arbitrary precision.
79+
// The zero value for a bigrat represents nil.
80+
type bigrat struct {
81+
*big.Rat
82+
}
83+
84+
func (a bigrat) + (b bigrat) bigrat
85+
func (a bigrat) - (b bigrat) bigrat
86+
func (a bigrat) * (b bigrat) bigrat
87+
func (a bigrat) / (b bigrat) bigrat
88+
89+
func (a bigrat) < (b bigrat) bool
90+
func (a bigrat) <= (b bigrat) bool
91+
func (a bigrat) > (b bigrat) bool
92+
func (a bigrat) >= (b bigrat) bool
93+
func (a bigrat) == (b bigrat) bool
94+
func (a bigrat) != (b bigrat) bool
95+
96+
func -(a bigrat) bigrat
97+
func /(a bigrat) bigrat
98+
99+
func (a bigrat) = (b bigrat)
100+
func (a bigrat) += (b bigrat)
101+
func (a bigrat) -= (b bigrat)
102+
func (a bigrat) *= (b bigrat)
103+
func (a bigrat) /= (b bigrat)
104+
105+
func bigrat() bigrat
106+
func bigrat(a bigint) bigrat
107+
func bigrat(a, b int64) bigrat
108+
109+
// -----------------------------------------------------------------------------
110+
// type bigfloat
111+
112+
// A bigfloat represents a multi-precision floating point number.
113+
// The zero value for a bigfloat represents nil.
114+
type bigfloat struct {
115+
*big.Float
116+
}
117+
118+
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)