core::num::impl isize
本頁內容
79absabs_diffchecked_abschecked_addchecked_divchecked_ilogchecked_ilog10checked_ilog2checked_isqrtchecked_mulchecked_negchecked_powchecked_remchecked_shlchecked_shrchecked_subcount_onescount_zerosdiv_eucliddiv_floorfrom_befrom_be_bytesfrom_be_bytesfrom_lefrom_le_bytesfrom_le_bytesfrom_ne_bytesfrom_ne_bytesilogilog10ilog2is_negativeis_positiveisqrtleading_onesleading_zerosoverflowing_addoverflowing_divoverflowing_muloverflowing_negoverflowing_powoverflowing_removerflowing_shloverflowing_shroverflowing_subpowrem_euclidrem_floorrotate_leftrotate_rightsaturating_abssaturating_addsaturating_mulsaturating_negsaturating_powsaturating_subsignumswap_bytesto_beto_be_bytesto_be_bytesto_leto_le_bytesto_le_bytesto_ne_bytesto_ne_bytestrailing_onestrailing_zerosunsigned_abswrapping_abswrapping_addwrapping_divwrapping_mulwrapping_negwrapping_powwrapping_remwrapping_shlwrapping_shrwrapping_sub
API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。
impl isize
The smallest value.
The largest value.
The width in bits.
The bytes, least significant first.
The bytes, most significant first.
The bytes in the target's byte order.
The number of
bytes, least significant first.The number of
bytes, most significant first.The number of
bytes, in the target's byte order.The smallest value.
The largest value.
The width in bits.
The bytes, least significant first.
The bytes, most significant first.
The bytes in the target's byte order.
The number of
bytes, least significant first.The number of
bytes, most significant first.The number of
bytes, in the target's byte order.self + rhs, wrapping around at the bounds.self - rhs, wrapping around at the bounds.self * rhs, wrapping around at the bounds.The number of one bits.
The number of zero bits.
The number of zero bits above the highest one bit.
The number of zero bits below the lowest one bit.
The number of one bits above the highest zero bit.
The number of one bits below the lowest zero bit.
The bits shifted left by
n, those shifted out coming back on the right.The bits shifted right by
n, those shifted out coming back on the left.The bytes in reverse order.
selfin big-endian byte order (unchanged on a big-endian target).selfin little-endian byte order (unchanged on a little-endian target).The number whose big-endian bytes are
x.The number whose little-endian bytes are
x.self + rhs, ornoneon overflow.self - rhs, ornoneon overflow.self * rhs, ornoneon overflow.self / rhs, ornonewhenrhsis 0 or the quotient overflows (MIN / -1).self % rhs, ornonewhenrhsis 0 or the division overflows (MIN % -1).-self, ornoneforMIN.self << n, ornonewhennis at leastBITS.self >> n, ornonewhennis at leastBITS.selfto theexp, ornoneon overflow.self / rhs;MIN / -1wraps toMIN. Panics whenrhsis 0.self % rhs;MIN % -1is 0. Panics whenrhsis 0.-self, wrapping around:MINstaysMIN.self << (n % BITS).self >> (n % BITS).selfto theexp, wrapping around at the bounds.self + rhs, clamped toMIN..=MAX.self - rhs, clamped toMIN..=MAX.self * rhs, clamped toMIN..=MAX.-self, clamped:MINgivesMAX.selfto theexp, clamped toMIN..=MAX.self + rhswrapped, and whether it overflowed.self - rhswrapped, and whether it overflowed.self * rhswrapped, and whether it overflowed.self / rhswrapped, and whether it overflowed (MIN / -1). Panics whenrhsis 0.self % rhswrapped, and whether it overflowed (MIN % -1). Panics whenrhsis 0.-selfwrapped, and whether it overflowed (MIN).self << (n % BITS), and whethernwas at leastBITS.self >> (n % BITS), and whethernwas at leastBITS.selfto theexpwrapped, and whether it overflowed.selfto theexp; overflow is the arithmetic's (a panic; a wrap with overflow checks off).The absolute value;
MIN.abs()overflows (panics; wraps with overflow checks off).The absolute value, or
noneforMIN.The absolute value, wrapping around:
MINstaysMIN.The absolute value, clamped:
MINgivesMAX.The absolute value as the unsigned type of the same width; never overflows.
|self - rhs|, as the unsigned type of the same width; never overflows.-1,0or1.truewhenself > 0.truewhenself < 0.Quotient rounded toward negative infinity (Python's
//);rem_flooris the matching remainder.The remainder with the divisor's sign (Python's
%, Nabi's%%):self == self.div_floor(rhs) * rhs + self.rem_floor(rhs).Quotient rounded so that
rem_euclidis never negative.The remainder in
0..rhs.abs().Integer square root; panics on a negative number.
The integer square root, or
nonefor a negative number.floor(log2(self)); panics unlessself > 0.floor(log10(self)); panics unlessself > 0.floor(log(self, base)); panics unlessself > 0andbase >= 2.floor(log2(self)), ornoneunlessself > 0.floor(log10(self)), ornoneunlessself > 0.floor(log(self, base)), ornoneunlessself > 0andbase >= 2.