Enum members for SamplingType.
Members:
GREEDY=0RANDOM=1RANDOM_SEED=2
Summary
Functions
Return a pair of integers, whose ratio is equal to the original int.
Number of ones in the binary representation of the absolute value of self.
Number of bits necessary to represent self in binary.
Returns self, the complex conjugate of any int.
Return the integer represented by the given array of bytes.
Returns True. Exists for duck type compatibility with float.is_integer.
Initialize self. See help(type(self)) for accurate signature.
Return an array of bytes representing an integer.
Types
Functions
@spec as_integer_ratio( SnakeBridge.Ref.t(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)Returns
term()
@spec bit_count( SnakeBridge.Ref.t(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3Returns
term()
@spec bit_length( SnakeBridge.Ref.t(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6Returns
term()
@spec conjugate(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Returns self, the complex conjugate of any int.
Returns
term()
@spec conjugate( SnakeBridge.Ref.t(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate( SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate(SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate( SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), term(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate( SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), term(), term() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate( SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), term(), term(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec conjugate( SnakeBridge.Ref.t(), term(), term(), term(), term(), term(), term(), term(), term() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec denominator(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec from_bytes(SnakeBridge.Ref.t(), term(), [term()], keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Return the integer represented by the given array of bytes.
bytes
Holds the array of bytes to convert. The argument must either
support the buffer protocol or be an iterable object producing bytes.
Bytes and bytearray are examples of built-in objects that support the
buffer protocol.
byteorder
The byte order used to represent the integer. If byteorder is 'big',
the most significant byte is at the beginning of the byte array. If
byteorder is 'little', the most significant byte is at the end of the
byte array. To request the native byte order of the host system, use
sys.byteorder as the byte order value. Default is to use 'big'.
signed
Indicates whether two's complement is used to represent the integer.
Parameters
bytes(term())byteorder(term() default: 'big')signed(term() keyword-only default: False)
Returns
term()
@spec greedy(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec imag(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec is_integer( SnakeBridge.Ref.t(), keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Returns True. Exists for duck type compatibility with float.is_integer.
Returns
term()
@spec new( [term()], keyword() ) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
Initialize self. See help(type(self)) for accurate signature.
Parameters
args(term())kwds(term())
@spec numerator(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec random(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec random_seed(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec real(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec to_bytes(SnakeBridge.Ref.t(), [term()], keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Return an array of bytes representing an integer.
length
Length of bytes object to use. An OverflowError is raised if the
integer is not representable with the given number of bytes. Default
is length 1.
byteorder
The byte order used to represent the integer. If byteorder is 'big',
the most significant byte is at the beginning of the byte array. If
byteorder is 'little', the most significant byte is at the end of the
byte array. To request the native byte order of the host system, use
sys.byteorder as the byte order value. Default is to use 'big'.
signed
Determines whether two's complement is used to represent the integer.
If signed is False and a negative integer is given, an OverflowError
is raised.
Parameters
length(term() default: 1)byteorder(term() default: 'big')signed(term() keyword-only default: False)
Returns
term()