Method (2) in int class, int Class Method

Source: Internet
Author: User

Method (2) in int class, int Class Method

25. _ pos _ (self, * args, ** kwargs)

Def _ pos _ (self, * args, ** kwargs): # real signature unknown
"+ Self """
Pass

26. _ pow _ (self, * args, ** kwargs)

Def _ pow _ (self, * args, ** kwargs): # real signature unknown
"Return pow (self, value, mod )."""

"Returns the multiplication of a number, and this function has a third parameter. after seeking the cosine, you can also find the remainder """
Pass

>>> A = 3
>>> A. _ pow _ (3)
27
>>> A. _ pow _ (3, 4)
3
27. _ radd _ (self, * args, ** kwargs)

Def _ radd _ (self, * args, ** kwargs): # real signature unknown
"Return value + self ."""

"Changed from self + value to value + self """
Pass

_ Radd _ (self, value) is the position for transforming the addend and the number to be added. self + value is changed to value + self:

>>> A = 13
>>> B = 14
>>> A. _ radd _ (B)
27
>>> A. _ add _ (B)
27
28. _ rand _ (self, value)

Def _ rand _ (self, * args, ** kwargs): # real signature unknown
"Return value & self ."""
Pass

Self & value is changed to value & self. The example is as follows:

>>> A = 10
>>> B = 50
>>> A. _ rand _ (B)
2
>>> A. _ and _ (B)
2
29. _ rdivmod __()

Def _ rdivmod _ (self, * args, ** kwargs): # real signature unknown
"" Return divmod (value, self )."""
Pass

_ Rdivmod _ (slef, value) is equivalent to _ divmod _ (value, self). div is the abbreviation of word division, return divisor, and mod is the abbreviation of remainder, returns the remainder, so the result is an array used to store the quotient and remainder.

>>> A = 55
>>> B = 15
>>> A. _ divmod _ (B)
(3, 10)
>>> A. _ rdivmod _ (B)
(0, 15)
30. _ rper _ (self, * args, ** kwargs)

Def _ repr _ (self, * args, ** kwargs): # real signature unknown
"" Return repr (self )."""
Pass

31. _ rfloordiv _ (self, value)

Def _ rfloordiv _ (self, * args, ** kwargs): # real signature unknown
"" Return value // self ."""
Pass

_ Rfloordiv _ (self, value) is equivalent to _ floordiv _ (value, self). The two parts are divided and then rounded.

>>> A = 5
>>> B = 3
>>> A. _ rfloordiv _ (B)
0
>>> A. _ floordiv _ (B)
1

31. _ round _ (self, * args, ** kwargs)
Def _ round _ (self, * args, ** kwargs): # real signature unknown
"""

Rounding
Rounding an Integral returns itself.
Rounding with an ndigits argument also returns an integer.
"""
Pass

32. _ rpow _ (self, * args, ** kwargs)

Def _ rpow _ (self, * args, ** kwargs): # real signature unknown
"Return pow (value, self, mod )."""
Pass

Take an example as follows:

>>> A = 4
>>> B = 3
>>> A. _ pow _ (B)
64
>>> A. _ rpow _ (B)
81
>>> A. _ pow _ (B, 3)
1
>>> A. _ rpow _ (B, 3)
0
33. _ rrshift _ (self, value)

Def _ rrshift _ (self, * args, ** kwargs): # real signature unknown
"Return value> self ."""
Pass

34. _ rshift _ (self, value)

Def _ rshift _ (self, * args, ** kwargs): # real signature unknown
"Return self> value ."""
Pass

35. _ rsub _ (self, * args, ** kwargs)

Def _ rsub _ (self, * args, ** kwargs): # real signature unknown
"" Return value-self ."""
Pass

36. _ rtruediv _ (self, value)

Def _ rtruediv _ (self, * args, ** kwargs): # real signature unknown
"" Return value/self ."""

"Reversing the divisor and the divisor """
Pass

Example:

>>> A = 10
>>> B = 4
>>> A. _ rtruediv _ (B)
0.4
>>> A. _ truediv _ (B)
2.5
37. _ rxor _ (self, value)

Def _ rxor _ (self, * args, ** kwargs): # real signature unknown
"Return value ^ self ."""
Pass

38. _ sizeof _ (self, * args, ** kwargs)

Def _ sizeof _ (self, * args, ** kwargs): # real signature unknown
"Returns size in memory, in bytes """
Pass

39. _ str _ (self, * args, ** kwargs)

Def _ str _ (self, * args, ** kwargs): # real signature unknown
"Return str (self )."""

"Convert numbers to strings """
Pass

Converts a number to a string, which is equivalent to str (a). The example is as follows:

>>> A = 15
>>> A. _ str __()
'15'
>>> Str ()
'15'

40. _ sub _ (self, * args, ** kwargs)

Def _ sub _ (self, * args, ** kwargs): # real signature unknown
"" Return self-value ."""
Pass

41. _ truediv __()

Def _ truediv _ (self, * args, ** kwargs): # real signature unknown
"" Return self/value ."""

"Returns the product of division of two numbers """
Pass

Example:

>>> A = 5
>>> B = 3
>>> A. _ truediv _ (B)
1.6666666666666667
>>> A. _ truediv _ (2)
2.5

42. _ trunc _ (self, * args, ** kwargs)

Def _ trunc _ (self, * args, ** kwargs): # real signature unknown
"Truncating an Integral returns itself ."""

"Truncation and tail rounding, mainly used for floating-point numbers """
Pass
Example:

>>> A = 3.9
>>> B = 2.0001
>>> A. _ trunc __()
3
>>> B. _ trunc __()
2
43. _ xor _ (self, * args, ** kwargs)

Def _ xor _ (self, * args, ** kwargs): # real signature unknown
"Return self ^ value ."""

"In binary format, both false and true """
Pass

Example:

1 0 1 a = 5

1 1 1 B = 7

0 1 0 a. _ xor _ (B) (a ^ B)

The result of the above operation in decimal 2 is as follows:

>>> A = 5
>>> B = 7
>>> A. _ xor _ (B)
2

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.