You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: py/int.go
+45-1
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,24 @@ package py
5
5
import (
6
6
"math"
7
7
"math/big"
8
+
"strconv"
8
9
)
9
10
10
-
varIntType=NewType("int", "int(x=0) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4")
11
+
varIntType=ObjectType.NewType("int", `
12
+
int(x=0) -> integer
13
+
int(x, base=10) -> integer
14
+
15
+
Convert a number or string to an integer, or return 0 if no arguments
16
+
are given. If x is a number, return x.__int__(). For floating point
17
+
numbers, this truncates towards zero.
18
+
19
+
If x is not a number or if base is given, then x must be a string,
20
+
bytes, or bytearray instance representing an integer literal in the
21
+
given base. The literal can be preceded by '+' or '-' and be surrounded
22
+
by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
23
+
Base 0 means to interpret the base from the string as an integer literal.
24
+
>>> int('0b100', base=0)
25
+
4`, IntNew, nil)
11
26
12
27
typeIntint64
13
28
@@ -35,6 +50,35 @@ func (o *BigInt) Type() *Type {
0 commit comments