_dtypes module¶
Default data types for internal use.
float_ class { #vectorbtpro.dtypes.float64 data-toc-label="float" }¶
Double-precision floating-point number type, compatible with Python float and C double.
:Character code: 'd' :Canonical name: numpy.double :Alias: numpy.float_ :Alias on this platform (Darwin arm64): numpy.float64: 64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa.
Superclasses
builtins.floatnumpy.floatingnumpy.genericnumpy.inexactnumpy.number
as_integer_ratio method¶
double.as_integer_ratio() -> (int, int)
Return a pair of integers, whose ratio is exactly equal to the original floating point number, and with a positive denominator. Raise OverflowError on infinities and a ValueError on NaNs.
np.double(10.0).as_integer_ratio() (10, 1) np.double(0.0).as_integer_ratio() (0, 1) np.double(-.25).as_integer_ratio() (-1, 4)
is_integer method¶
double.is_integer() -> bool
Return True if the floating point number is finite with integral value, and False otherwise.
.. versionadded:: 1.22
Examples¶
np.double(-2.0).is_integer() True np.double(3.2).is_integer() False
int_ class { #vectorbtpro.dtypes.int64 data-toc-label="int" }¶
Signed integer type, compatible with Python int and C long.
:Character code: 'l' :Canonical name: numpy.int_ :Alias on this platform (Darwin arm64): numpy.int64: 64-bit signed integer (-9_223_372_036_854_775_808 to 9_223_372_036_854_775_807). :Alias on this platform (Darwin arm64): numpy.intp: Signed integer large enough to fit pointer, compatible with C intptr_t.
Superclasses
numpy.genericnumpy.integernumpy.numbernumpy.signedinteger
bit_count method¶
int64.bit_count() -> int
Computes the number of 1-bits in the absolute value of the input. Analogous to the builtin int.bit_count or popcount in C++.
Examples¶
np.int64(127).bit_count() 7 np.int64(-127).bit_count() 7