Integer[A: Integer[A] val]¶
Implements¶
- Real[A] val
Constructors¶
create¶
Parameters¶
- value: A
Returns¶
- Real[A] val^
from[B: ((I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val) & Real[B] val)]¶
new val from[B: ((I8 val | I16 val | I32 val |
I64 val | I128 val | ILong val |
ISize val | U8 val | U16 val |
U32 val | U64 val | U128 val |
ULong val | USize val | F32 val |
F64 val) & Real[B] val)](
a: B)
: Real[A] val^
Parameters¶
- a: B
Returns¶
- Real[A] val^
min_value¶
Returns¶
- Real[A] val^
max_value¶
Returns¶
- Real[A] val^
Public Functions¶
add_unsafe¶
Unsafe operation. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
sub_unsafe¶
Unsafe operation. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
mul_unsafe¶
Unsafe operation. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
div_unsafe¶
Integer division, rounded towards zero.
Unsafe operation. If y is 0, the result is undefined. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
divrem_unsafe¶
Calculates the quotient of this number and y
and the remainder.
Unsafe operation. If y is 0, the result is undefined. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- (A , A)
rem_unsafe¶
Calculates the remainder of this number divided by y
.
Unsafe operation. If y is 0, the result is undefined. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
fld_unsafe¶
Floored division, rounded towards negative infinity,
as opposed to div
which rounds towards zero.
Unsafe Operation
If y is 0, the result is undefined. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
mod_unsafe¶
Calculates the modulo of this number after floored division by y
.
Unsafe Operation.
If y is 0, the result is undefined. If the operation overflows, the result is undefined.
Parameters¶
- y: A
Returns¶
- A
add_partial¶
Add y to this number.
If the operation overflows this function errors.
Parameters¶
- y: A
Returns¶
- A ?
sub_partial¶
Subtract y from this number.
If the operation overflows/underflows this function errors.
Parameters¶
- y: A
Returns¶
- A ?
mul_partial¶
Multiply y with this number.
If the operation overflows this function errors.
Parameters¶
- y: A
Returns¶
- A ?
div_partial¶
Divides this number by y
, rounds the result towards zero.
If y is 0
or the operation overflows, this function errors.
Parameters¶
- y: A
Returns¶
- A ?
rem_partial¶
Calculates the remainder of this number divided by y. The result has the sign of the dividend.
If y is 0
or the operation overflows, this function errors.
Parameters¶
- y: A
Returns¶
- A ?
divrem_partial¶
Divides this number by y and calculates the remainder of the operation.
If y is 0
or the operation overflows, this function errors.
Parameters¶
- y: A
Returns¶
- (A , A) ?
fld_partial¶
Floored integer division, rounded towards negative infinity.
If y is 0
or the operation overflows, this function errors
Parameters¶
- y: A
Returns¶
- A ?
mod_partial¶
Calculates the modulo of this number and y
after floored division (fld
).
The result has the sign of the divisor.
If y is 0
or the operation overflows, this function errors.
Parameters¶
- y: A
Returns¶
- A ?
neg_unsafe¶
Unsafe operation. If the operation overflows, the result is undefined.
Returns¶
- A
addc¶
Add y
to this integer and return the result and a flag indicating overflow.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
subc¶
Subtract y
from this integer and return the result and a flag indicating overflow.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
mulc¶
Multiply y
with this integer and return the result and a flag indicating overflow.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
divc¶
Divide this integer by y
and return the result and a flag indicating overflow or division by zero.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
remc¶
Calculate the remainder of this number divided by y
and return the result and a flag indicating division by zero or overflow.
The result will have the sign of the dividend.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
fldc¶
Divide this integer by y
and return the result, rounded towards negative infinity and a flag indicating overflow or division by zero.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
modc¶
Calculate the modulo of this number after floored division by y
and return the result and a flag indicating division by zero or overflow.
The result will have the sign of the divisor.
Parameters¶
- y: A
Returns¶
- (A , Bool val)
op_and¶
Parameters¶
- y: A
Returns¶
- A
op_or¶
Parameters¶
- y: A
Returns¶
- A
op_xor¶
Parameters¶
- y: A
Returns¶
- A
op_not¶
Returns¶
- A
bit_reverse¶
Reverse the order of the bits within the integer. For example, 0b11101101 (237) would return 0b10110111 (183).
Returns¶
- A
bswap¶
Returns¶
- A
add¶
Parameters¶
- y: A
Returns¶
- A
sub¶
Parameters¶
- y: A
Returns¶
- A
mul¶
Parameters¶
- y: A
Returns¶
- A
div¶
Parameters¶
- y: A
Returns¶
- A
divrem¶
Parameters¶
- y: A
Returns¶
- (A , A)
rem¶
Parameters¶
- y: A
Returns¶
- A
neg¶
Returns¶
- A
fld¶
Parameters¶
- y: A
Returns¶
- A
mod¶
Parameters¶
- y: A
Returns¶
- A
eq¶
Parameters¶
- y: box->A
Returns¶
- Bool val
ne¶
Parameters¶
- y: box->A
Returns¶
- Bool val
lt¶
Parameters¶
- y: box->A
Returns¶
- Bool val
le¶
Parameters¶
- y: box->A
Returns¶
- Bool val
ge¶
Parameters¶
- y: box->A
Returns¶
- Bool val
gt¶
Parameters¶
- y: box->A
Returns¶
- Bool val
min¶
Parameters¶
- y: A
Returns¶
- A
max¶
Parameters¶
- y: A
Returns¶
- A
hash¶
Returns¶
- USize val
hash64¶
Returns¶
- U64 val
string¶
Returns¶
- String iso^
i8¶
Returns¶
- I8 val
i16¶
Returns¶
- I16 val
i32¶
Returns¶
- I32 val
i64¶
Returns¶
- I64 val
i128¶
Returns¶
- I128 val
ilong¶
Returns¶
- ILong val
isize¶
Returns¶
- ISize val
u8¶
Returns¶
- U8 val
u16¶
Returns¶
- U16 val
u32¶
Returns¶
- U32 val
u64¶
Returns¶
- U64 val
u128¶
Returns¶
- U128 val
ulong¶
Returns¶
- ULong val
usize¶
Returns¶
- USize val
f32¶
Returns¶
- F32 val
f64¶
Returns¶
- F64 val
i8_unsafe¶
Returns¶
- I8 val
i16_unsafe¶
Returns¶
- I16 val
i32_unsafe¶
Returns¶
- I32 val
i64_unsafe¶
Returns¶
- I64 val
i128_unsafe¶
Returns¶
- I128 val
ilong_unsafe¶
Returns¶
- ILong val
isize_unsafe¶
Returns¶
- ISize val
u8_unsafe¶
Returns¶
- U8 val
u16_unsafe¶
Returns¶
- U16 val
u32_unsafe¶
Returns¶
- U32 val
u64_unsafe¶
Returns¶
- U64 val
u128_unsafe¶
Returns¶
- U128 val
ulong_unsafe¶
Returns¶
- ULong val
usize_unsafe¶
Returns¶
- USize val
f32_unsafe¶
Returns¶
- F32 val
f64_unsafe¶
Returns¶
- F64 val
compare¶
Parameters¶
- that: box->A