IntInit
Description
Initialize an Int (numeric value 0). Inside a Scope block the allocator argument may be omitted (MisraScope is used). Otherwise pass a typed allocator handle or a raw Allocator *.
Usage example (from documentation)
Scope(alloc, DefaultAllocator) {
Int value = IntInit();
...
}Success
Returns a numerically-zero Int whose backing bitvector is bound to the chosen allocator.
Failure
Cannot fail at construction; first allocator OOM surfaces from later math/grow.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:3379:
Str temp = StrInitFromCstr(start, StrIterIndex(&si) - StrIterIndex(&saved), IntAllocator(value));
Int parsed = IntInit(IntAllocator(value));
bool ok = IntTryFromStrRadix(&parsed, StrBegin(&temp), radix);- In
Int.c:43:
if (capacity != 0 && BitVecCapacity(INT_BITS(out)) < capacity) {
IntDeinit(out);
*out = IntInit(alloc);
return false;
}- In
Int.c:57:
}
*out = IntInit(alloc);
if (bits == 0) {
return true;- In
Int.c:64:
if (!BitVecTryFromInteger(INT_BITS(out), value, bits, alloc)) {
IntDeinit(out);
*out = IntInit(alloc);
return false;
}- In
Int.c:123:
static SignedInt sint_init(Allocator *alloc) {
SignedInt value = {.negative = false, .magnitude = IntInit(alloc)};
return value;
}- In
Int.c:235:
Int lhs;
Int rhs;
Int result = IntInit(IntAllocator(value));
if (!int_try_clone_value(&lhs, value)) {- In
Int.c:260:
Int lhs;
Int rhs;
Int result = IntInit(IntAllocator(value));
if (!int_try_clone_value(&lhs, value)) {- In
Int.c:326:
ValidateInt(out);
result = IntInit(IntAllocator(out));
if (!int_validate_radix(radix)) {- In
Int.c:447:
ValidateInt(value);
*out = IntInit(IntAllocator(value));
if (!BitVecTryClone(INT_BITS(out), INT_BITS(value))) {
return false;- In
Int.c:464:
ValidateInt(value);
clone = IntInit(IntAllocator(value));
(void)int_try_clone_value(&clone, value);
return clone;- In
Int.c:470:
Int int_from_u64(u64 value, Allocator *alloc) {
Int result = IntInit(alloc);
(void)int_try_from_u64(&result, value, alloc);- In
Int.c:516:
}
Int result = IntInit(alloc);
if (len == 0) {- In
Int.c:571:
}
Int result = IntInit(alloc);
for (u64 i = 0; i < len; i++) {- In
Int.c:576:
if (!IntShiftLeft(&result, 8) || !int_add_u64_in_place(&result, bytes[i])) {
IntDeinit(&result);
return IntInit(alloc);
}
}- In
Int.c:651:
Int int_from_str_zstr(Zstr decimal, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_str_zstr(&out, decimal);- In
Int.c:658:
Int int_from_str_str(const Str *decimal, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_str_str(&out, decimal);- In
Int.c:709:
Int int_from_str_radix_zstr(Zstr digits, u8 radix, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_str_radix_zstr(&out, digits, radix);- In
Int.c:716:
Int int_from_str_radix_str(const Str *digits, u8 radix, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_str_radix_str(&out, digits, radix);- In
Int.c:749:
while (!IntIsZero(¤t)) {
Int quotient = IntInit(alloc);
u64 digit = 0;- In
Int.c:821:
Int int_from_binary_zstr(Zstr binary, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_binary_zstr(&out, binary);- In
Int.c:828:
Int int_from_binary_str(const Str *binary, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_binary_str(&out, binary);- In
Int.c:870:
Int int_from_oct_str_zstr(Zstr octal, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_oct_str_zstr(&out, octal);- In
Int.c:877:
Int int_from_oct_str_str(const Str *octal, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_oct_str_str(&out, octal);- In
Int.c:907:
Int int_from_hex_str_zstr(Zstr hex, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_hex_str_zstr(&out, hex);- In
Int.c:914:
Int int_from_hex_str_str(const Str *hex, Allocator *alloc) {
Int out = IntInit(alloc);
(void)int_try_from_hex_str_str(&out, hex);- In
Int.c:1210:
u64 b_bits = IntBitLength(b);
Int acc = IntInit(IntAllocator(result));
if (IntIsZero(a) || IntIsZero(b)) {- In
Int.c:1224:
Int partial;
Int next = IntInit(IntAllocator(result));
if (!int_try_clone_value(&partial, a)) {- In
Int.c:1309:
while (exponent > 0) {
if (exponent & 1u) {
Int next = IntInit(IntAllocator(result));
if (!int_mul(&next, &acc, ¤t)) {- In
Int.c:1323:
exponent >>= 1u;
if (exponent > 0) {
Int next = IntInit(IntAllocator(result));
if (!IntSquare(&next, ¤t)) {- In
Int.c:1363:
}
Int normalized_dividend = IntInit(IntAllocator(quotient));
Int normalized_divisor = IntInit(IntAllocator(quotient));
Int q = IntInit(IntAllocator(quotient));- In
Int.c:1364:
Int normalized_dividend = IntInit(IntAllocator(quotient));
Int normalized_divisor = IntInit(IntAllocator(quotient));
Int q = IntInit(IntAllocator(quotient));
Int r = IntInit(IntAllocator(remainder));- In
Int.c:1365:
Int normalized_dividend = IntInit(IntAllocator(quotient));
Int normalized_divisor = IntInit(IntAllocator(quotient));
Int q = IntInit(IntAllocator(quotient));
Int r = IntInit(IntAllocator(remainder));
bool ok = false;- In
Int.c:1366:
Int normalized_divisor = IntInit(IntAllocator(quotient));
Int q = IntInit(IntAllocator(quotient));
Int r = IntInit(IntAllocator(remainder));
bool ok = false;- In
Int.c:1385:
for (u64 shift = dividend_bits - divisor_bits + 1; shift > 0; shift--) {
u64 bit = shift - 1;
Int shifted = IntInit(IntAllocator(quotient));
if (!int_try_clone_value(&shifted, &normalized_divisor) || !IntShiftLeft(&shifted, bit)) {- In
Int.c:1393:
if (IntGE(&r, &shifted)) {
Int next = IntInit(IntAllocator(quotient));
if (!int_sub(&next, &r, &shifted)) {- In
Int.c:1414:
} else {
IntDeinit(&q);
q = IntInit(IntAllocator(quotient));
}- In
Int.c:1436:
bool int_div(Int *result, const Int *dividend, const Int *divisor) {
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));- In
Int.c:1437:
bool int_div(Int *result, const Int *dividend, const Int *divisor) {
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));
if (!int_div_mod("ient, &remainder, dividend, divisor)) {- In
Int.c:1460:
}
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));- In
Int.c:1461:
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));
if (!int_div_mod("ient, &remainder, dividend, divisor)) {- In
Int.c:1480:
bool int_div_u64(Int *result, const Int *dividend, u64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_u64(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1493:
bool int_div_i64(Int *result, const Int *dividend, i64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_i64_with_allocator(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1506:
bool int_div_exact_u64(Int *result, const Int *dividend, u64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_u64(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1519:
bool int_div_exact_i64(Int *result, const Int *dividend, i64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_i64_with_allocator(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1532:
bool int_div_mod_u64(Int *quotient, Int *remainder, const Int *dividend, u64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_u64(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1545:
bool int_div_mod_i64(Int *quotient, Int *remainder, const Int *dividend, i64 divisor) {
Int divisor_value = IntInit(IntAllocator(dividend));
if (!int_try_from_i64_with_allocator(&divisor_value, divisor, IntAllocator(dividend))) {- In
Int.c:1566:
}
Int divisor_value = IntInit(IntAllocator(dividend));
Int remainder = IntInit(IntAllocator(quotient));
u64 rem = 0;- In
Int.c:1567:
Int divisor_value = IntInit(IntAllocator(dividend));
Int remainder = IntInit(IntAllocator(quotient));
u64 rem = 0;- In
Int.c:1589:
bool int_mod(Int *result, const Int *dividend, const Int *divisor) {
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));- In
Int.c:1590:
bool int_mod(Int *result, const Int *dividend, const Int *divisor) {
Int quotient = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));
if (!int_div_mod("ient, &remainder, dividend, divisor)) {- In
Int.c:1604:
bool int_mod_u64_into(Int *result, const Int *dividend, u64 divisor) {
Int quotient = IntInit(IntAllocator(result));
bool ok = int_div_mod_u64("ient, result, dividend, divisor);- In
Int.c:1612:
bool int_mod_i64_into(Int *result, const Int *dividend, i64 divisor) {
Int quotient = IntInit(IntAllocator(result));
bool ok = int_div_mod_i64("ient, result, dividend, divisor);- In
Int.c:1627:
}
Int quotient = IntInit(IntAllocator(value));
u64 rem = int_div_u64_rem("ient, value, modulus);- In
Int.c:1639:
ValidateInt(b);
Int x = IntInit(IntAllocator(a));
Int y = IntInit(IntAllocator(b));- In
Int.c:1640:
Int x = IntInit(IntAllocator(a));
Int y = IntInit(IntAllocator(b));
if (!int_try_clone_value(&x, a) || !int_try_clone_value(&y, b)) {- In
Int.c:1649:
while (!IntIsZero(&y)) {
Int r = IntInit(IntAllocator(result));
if (!int_mod(&r, &x, &y)) {- In
Int.c:1673:
if (IntIsZero(a) || IntIsZero(b)) {
Int zero = IntInit(IntAllocator(result));
int_replace(result, &zero);
return true;- In
Int.c:1678:
}
Int gcd = IntInit(IntAllocator(result));
Int quotient = IntInit(IntAllocator(result));
Int lcm = IntInit(IntAllocator(result));- In
Int.c:1679:
Int gcd = IntInit(IntAllocator(result));
Int quotient = IntInit(IntAllocator(result));
Int lcm = IntInit(IntAllocator(result));- In
Int.c:1680:
Int gcd = IntInit(IntAllocator(result));
Int quotient = IntInit(IntAllocator(result));
Int lcm = IntInit(IntAllocator(result));
if (!IntGCD(&gcd, a, b) || !int_div("ient, a, &gcd) || !int_mul(&lcm, "ient, b)) {- In
Int.c:1709:
if (IntIsZero(value)) {
Int zero_root = IntInit(IntAllocator(root));
Int zero_rem = IntInit(IntAllocator(remainder));- In
Int.c:1710:
if (IntIsZero(value)) {
Int zero_root = IntInit(IntAllocator(root));
Int zero_rem = IntInit(IntAllocator(remainder));
int_replace(root, &zero_root);- In
Int.c:1717:
}
if (degree == 1) {
Int exact_root = IntInit(IntAllocator(root));
Int zero_rem = IntInit(IntAllocator(remainder));- In
Int.c:1718:
if (degree == 1) {
Int exact_root = IntInit(IntAllocator(root));
Int zero_rem = IntInit(IntAllocator(remainder));
if (!IntTryClone(&exact_root, value)) {- In
Int.c:1732:
u64 bits = IntBitLength(value);
u64 high_shift = bits / degree;
Int low = IntInit(IntAllocator(root));
Int high = IntInit(IntAllocator(root));
Int best = IntInit(IntAllocator(root));- In
Int.c:1733:
u64 high_shift = bits / degree;
Int low = IntInit(IntAllocator(root));
Int high = IntInit(IntAllocator(root));
Int best = IntInit(IntAllocator(root));
Int one = IntInit(IntAllocator(root));- In
Int.c:1734:
Int low = IntInit(IntAllocator(root));
Int high = IntInit(IntAllocator(root));
Int best = IntInit(IntAllocator(root));
Int one = IntInit(IntAllocator(root));- In
Int.c:1735:
Int high = IntInit(IntAllocator(root));
Int best = IntInit(IntAllocator(root));
Int one = IntInit(IntAllocator(root));
if ((bits % degree) != 0) {- In
Int.c:1761:
while (IntLE(&low, &high)) {
Int sum = IntInit(IntAllocator(root));
Int mid = IntInit(IntAllocator(root));
Int mid_pow = IntInit(IntAllocator(root));- In
Int.c:1762:
while (IntLE(&low, &high)) {
Int sum = IntInit(IntAllocator(root));
Int mid = IntInit(IntAllocator(root));
Int mid_pow = IntInit(IntAllocator(root));
int cmp = 0;- In
Int.c:1763:
Int sum = IntInit(IntAllocator(root));
Int mid = IntInit(IntAllocator(root));
Int mid_pow = IntInit(IntAllocator(root));
int cmp = 0;- In
Int.c:1790:
if (cmp <= 0) {
Int next = IntInit(IntAllocator(root));
IntDeinit(&best);- In
Int.c:1816:
low = next;
} else {
Int next = IntInit(IntAllocator(root));
if (IntEQ(&mid, &one) || IntIsZero(&mid)) {- In
Int.c:1820:
if (IntEQ(&mid, &one) || IntIsZero(&mid)) {
IntDeinit(&high);
high = IntInit(IntAllocator(root));
} else {
if (!int_sub(&next, &mid, &one)) {- In
Int.c:1842:
{
Int power = IntInit(IntAllocator(root));
Int rem = IntInit(IntAllocator(remainder));- In
Int.c:1843:
{
Int power = IntInit(IntAllocator(root));
Int rem = IntInit(IntAllocator(remainder));
if (!int_pow_u64(&power, &best, degree) || !int_sub(&rem, value, &power)) {- In
Int.c:1868:
bool IntRoot(Int *result, const Int *value, u64 degree) {
Int root = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));- In
Int.c:1869:
bool IntRoot(Int *result, const Int *value, u64 degree) {
Int root = IntInit(IntAllocator(result));
Int remainder = IntInit(IntAllocator(result));
if (!IntRootRem(&root, &remainder, value, degree)) {- In
Int.c:1893:
ValidateInt(value);
Int root = IntInit(IntAllocator(value));
Int remainder = IntInit(IntAllocator(value));
bool result = false;- In
Int.c:1894:
Int root = IntInit(IntAllocator(value));
Int remainder = IntInit(IntAllocator(value));
bool result = false;- In
Int.c:1923:
for (u64 degree = 2; degree <= max_degree; degree++) {
Int root = IntInit(IntAllocator(value));
Int remainder = IntInit(IntAllocator(value));
bool exact = false;- In
Int.c:1924:
for (u64 degree = 2; degree <= max_degree; degree++) {
Int root = IntInit(IntAllocator(value));
Int remainder = IntInit(IntAllocator(value));
bool exact = false;- In
Int.c:1958:
}
Int aa = IntInit(IntAllocator(a));
Int nn = IntInit(IntAllocator(n));
int result = 1;- In
Int.c:1959:
Int aa = IntInit(IntAllocator(a));
Int nn = IntInit(IntAllocator(n));
int result = 1;- In
Int.c:2030:
}
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int sum = IntInit(IntAllocator(result));- In
Int.c:2031:
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int sum = IntInit(IntAllocator(result));- In
Int.c:2032:
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int sum = IntInit(IntAllocator(result));
if (!int_mod(&ar, a, modulus) || !int_mod(&br, b, modulus) || !int_add(&sum, &ar, &br) ||- In
Int.c:2059:
}
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));- In
Int.c:2060:
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
if (!int_mod(&ar, a, modulus) || !int_mod(&br, b, modulus)) {- In
Int.c:2075:
}
} else {
Int diff = IntInit(IntAllocator(result));
if (!int_sub(&diff, &br, &ar)) {- In
Int.c:2084:
}
if (IntIsZero(&diff)) {
Int zero = IntInit(IntAllocator(result));
int_replace(result, &zero);
} else {- In
Int.c:2114:
}
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int prod = IntInit(IntAllocator(result));- In
Int.c:2115:
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int prod = IntInit(IntAllocator(result));- In
Int.c:2116:
Int ar = IntInit(IntAllocator(result));
Int br = IntInit(IntAllocator(result));
Int prod = IntInit(IntAllocator(result));
if (!int_mod(&ar, a, modulus) || !int_mod(&br, b, modulus) || !int_mul(&prod, &ar, &br) ||- In
Int.c:2143:
}
Int inverse = IntInit(IntAllocator(result));
Int value = IntInit(IntAllocator(result));
bool ok = false;- In
Int.c:2144:
Int inverse = IntInit(IntAllocator(result));
Int value = IntInit(IntAllocator(result));
bool ok = false;- In
Int.c:2178:
}
Int acc = IntInit(IntAllocator(result));
Int base_mod = IntInit(IntAllocator(result));- In
Int.c:2179:
Int acc = IntInit(IntAllocator(result));
Int base_mod = IntInit(IntAllocator(result));
if (!int_try_from_u64(&acc, 1, IntAllocator(result))) {- In
Int.c:2193:
while (exponent > 0) {
if (exponent & 1u) {
Int next = IntInit(IntAllocator(result));
if (!IntModMul(&next, &acc, &base_mod, modulus)) {- In
Int.c:2207:
exponent >>= 1u;
if (exponent > 0) {
Int next = IntInit(IntAllocator(result));
if (!IntModMul(&next, &base_mod, &base_mod, modulus)) {- In
Int.c:2236:
}
Int acc = IntInit(IntAllocator(result));
Int base_mod = IntInit(IntAllocator(result));
Int exp = IntInit(IntAllocator(exponent));- In
Int.c:2237:
Int acc = IntInit(IntAllocator(result));
Int base_mod = IntInit(IntAllocator(result));
Int exp = IntInit(IntAllocator(exponent));- In
Int.c:2238:
Int acc = IntInit(IntAllocator(result));
Int base_mod = IntInit(IntAllocator(result));
Int exp = IntInit(IntAllocator(exponent));
if (!int_try_from_u64(&acc, 1, IntAllocator(result)) || !IntTryClone(&exp, exponent) ||- In
Int.c:2250:
while (!IntIsZero(&exp)) {
if (int_is_odd(&exp)) {
Int next = IntInit(IntAllocator(result));
if (!IntModMul(&next, &acc, &base_mod, modulus)) {- In
Int.c:2270:
}
if (!IntIsZero(&exp)) {
Int next = IntInit(IntAllocator(result));
if (!IntModMul(&next, &base_mod, &base_mod, modulus)) {- In
Int.c:2308:
}
Int reduced = IntInit(IntAllocator(result));
SignedInt t = sint_init(IntAllocator(result));
SignedInt new_t = sint_from_u64(1, IntAllocator(result));- In
Int.c:2311:
SignedInt t = sint_init(IntAllocator(result));
SignedInt new_t = sint_from_u64(1, IntAllocator(result));
Int r = IntInit(IntAllocator(modulus));
Int new_r = IntInit(IntAllocator(result));
Int one = int_from_u64(1, IntAllocator(result));- In
Int.c:2312:
SignedInt new_t = sint_from_u64(1, IntAllocator(result));
Int r = IntInit(IntAllocator(modulus));
Int new_r = IntInit(IntAllocator(result));
Int one = int_from_u64(1, IntAllocator(result));
bool ok = false;- In
Int.c:2336:
while (!IntIsZero(&new_r)) {
Int q = IntInit(IntAllocator(result));
Int rem = IntInit(IntAllocator(result));
SignedInt q_new_t = sint_init(IntAllocator(result));- In
Int.c:2337:
while (!IntIsZero(&new_r)) {
Int q = IntInit(IntAllocator(result));
Int rem = IntInit(IntAllocator(result));
SignedInt q_new_t = sint_init(IntAllocator(result));
SignedInt next_t = sint_init(IntAllocator(result));- In
Int.c:2340:
SignedInt q_new_t = sint_init(IntAllocator(result));
SignedInt next_t = sint_init(IntAllocator(result));
Int next_r = IntInit(IntAllocator(result));
if (!int_div_mod(&q, &rem, &r, &new_r) || !sint_mul_unsigned(&q_new_t, &new_t, &q) ||- In
Int.c:2374:
if (IntEQ(&r, &one)) {
Int positive = IntInit(IntAllocator(result));
Int mag_mod = IntInit(IntAllocator(result));- In
Int.c:2375:
if (IntEQ(&r, &one)) {
Int positive = IntInit(IntAllocator(result));
Int mag_mod = IntInit(IntAllocator(result));
if (!int_mod(&mag_mod, &t.magnitude, modulus)) {- In
Int.c:2438:
}
Int a = IntInit(IntAllocator(result));
bool ok = false;- In
Int.c:2447:
if (IntIsZero(&a)) {
Int zero = IntInit(IntAllocator(result));
int_replace(result, &zero);
IntDeinit(&a);- In
Int.c:2477:
}
if (int_mod_u64(modulus, 4) == 3) {
Int exponent = IntInit(IntAllocator(modulus));
Int root = IntInit(IntAllocator(result));- In
Int.c:2478:
if (int_mod_u64(modulus, 4) == 3) {
Int exponent = IntInit(IntAllocator(modulus));
Int root = IntInit(IntAllocator(result));
if (!IntTryClone(&exponent, modulus) || !int_add_u64(&exponent, &exponent, 1) || !IntShiftRight(&exponent, 2) ||- In
Int.c:2495:
{
Int q = IntInit(IntAllocator(modulus));
Int z = IntInit(IntAllocator(modulus));
Int c = IntInit(IntAllocator(result));- In
Int.c:2496:
{
Int q = IntInit(IntAllocator(modulus));
Int z = IntInit(IntAllocator(modulus));
Int c = IntInit(IntAllocator(result));
Int t = IntInit(IntAllocator(result));- In
Int.c:2497:
Int q = IntInit(IntAllocator(modulus));
Int z = IntInit(IntAllocator(modulus));
Int c = IntInit(IntAllocator(result));
Int t = IntInit(IntAllocator(result));
Int r = IntInit(IntAllocator(result));- In
Int.c:2498:
Int z = IntInit(IntAllocator(modulus));
Int c = IntInit(IntAllocator(result));
Int t = IntInit(IntAllocator(result));
Int r = IntInit(IntAllocator(result));
Int exponent = IntInit(IntAllocator(result));- In
Int.c:2499:
Int c = IntInit(IntAllocator(result));
Int t = IntInit(IntAllocator(result));
Int r = IntInit(IntAllocator(result));
Int exponent = IntInit(IntAllocator(result));
u64 m = 0;- In
Int.c:2500:
Int t = IntInit(IntAllocator(result));
Int r = IntInit(IntAllocator(result));
Int exponent = IntInit(IntAllocator(result));
u64 m = 0;- In
Int.c:2581:
while (int_compare_u64(&t, 1) != 0) {
Int t_power = IntInit(IntAllocator(&t));
u64 i = 0;- In
Int.c:2597:
for (i = 1; i < m; i++) {
Int next = IntInit(IntAllocator(result));
if (!IntSquareMod(&next, &t_power, modulus)) {- In
Int.c:2625:
{
Int b = IntInit(IntAllocator(&c));
Int b_sq = IntInit(IntAllocator(result));
Int next = IntInit(IntAllocator(result));- In
Int.c:2626:
{
Int b = IntInit(IntAllocator(&c));
Int b_sq = IntInit(IntAllocator(result));
Int next = IntInit(IntAllocator(result));- In
Int.c:2627:
Int b = IntInit(IntAllocator(&c));
Int b_sq = IntInit(IntAllocator(result));
Int next = IntInit(IntAllocator(result));
if (!IntTryClone(&b, &c)) {- In
Int.c:2645:
for (u64 j = 0; j + i + 1 < m; j++) {
Int square = IntInit(IntAllocator(result));
if (!IntSquareMod(&square, &b, modulus)) {- In
Int.c:2696:
return false;
}
next = IntInit(IntAllocator(result));
if (!IntModMul(&next, &t, &b_sq, modulus)) {
IntDeinit(&b);- In
Int.c:2769:
{
Int d = IntInit(IntAllocator(value));
Int n_minus_one = IntInit(IntAllocator(value));
u64 s = 0;- In
Int.c:2770:
{
Int d = IntInit(IntAllocator(value));
Int n_minus_one = IntInit(IntAllocator(value));
u64 s = 0;
bool probable = true;- In
Int.c:2795:
for (u64 i = 0; i < (u64)(sizeof(bases) / sizeof(bases[0])); i++) {
Int base = IntInit(IntAllocator(value));
Int x = IntInit(IntAllocator(value));- In
Int.c:2796:
for (u64 i = 0; i < (u64)(sizeof(bases) / sizeof(bases[0])); i++) {
Int base = IntInit(IntAllocator(value));
Int x = IntInit(IntAllocator(value));
if (!int_try_from_u64(&base, bases[i], IntAllocator(value))) {- In
Int.c:2829:
for (u64 r = 1; r < s; r++) {
Int next = IntInit(IntAllocator(value));
if (!IntSquareMod(&next, &x, value)) {- In
Int.c:2873:
if (int_compare_u64(value, 1) <= 0) {
Int two = IntInit(IntAllocator(result));
if (!int_try_from_u64(&two, 2, IntAllocator(result))) {- In
Int.c:2883:
}
Int candidate = IntInit(IntAllocator(result));
if (!IntTryClone(&candidate, value)) {- In
Int.c:2895:
}
if (int_compare_u64(&candidate, 2) <= 0) {
Int two = IntInit(IntAllocator(result));
if (!int_try_from_u64(&two, 2, IntAllocator(result))) {- In
Float.c:77:
} else if (binexp < 0) {
u64 n = (u64)(-(i64)binexp);
Int five = IntInit(alloc);
Int pow5 = IntInit(alloc);
Int sig = IntInit(alloc);- In
Float.c:78:
u64 n = (u64)(-(i64)binexp);
Int five = IntInit(alloc);
Int pow5 = IntInit(alloc);
Int sig = IntInit(alloc);
if (!int_try_from_u64(&five, 5u, alloc) || !IntPow(&pow5, &five, n) ||- In
Float.c:79:
Int five = IntInit(alloc);
Int pow5 = IntInit(alloc);
Int sig = IntInit(alloc);
if (!int_try_from_u64(&five, 5u, alloc) || !IntPow(&pow5, &five, n) ||
!int_mul(&sig, &out->significand, &pow5)) {- In
Float.c:200:
{
u64 places = (u64)(value->exponent - target_exponent);
Int factor = IntInit(FloatAllocator(value));
Int scaled = IntInit(FloatAllocator(value));- In
Float.c:201:
u64 places = (u64)(value->exponent - target_exponent);
Int factor = IntInit(FloatAllocator(value));
Int scaled = IntInit(FloatAllocator(value));
if (!float_pow10(&factor, places, FloatAllocator(value)) || !int_mul(&scaled, &value->significand, &factor)) {- In
Float.c:260:
while (int_mod_u64(&value->significand, 10) == 0) {
Int quotient = IntInit(FloatAllocator(value));
(void)int_div_u64_rem("ient, &value->significand, 10);- In
Float.c:409:
ValidateFloat(value);
Int temp = IntInit(IntAllocator(result));
if (FloatIsNegative(value)) {- In
Float.c:423:
if (value->exponent >= 0) {
Int factor = IntInit(FloatAllocator(value));
if (!IntTryClone(&temp, &value->significand) ||- In
Float.c:440:
{
u64 places = (u64)(-value->exponent);
Int factor = IntInit(FloatAllocator(value));
bool ok = false;- In
Float.c:1165:
bool float_div(Float *result, const Float *a, const Float *b, u64 precision) {
Float temp = FloatInit(FloatAllocator(result));
Int scale = IntInit(FloatAllocator(result));
Int scaled = IntInit(FloatAllocator(result));- In
Float.c:1166:
Float temp = FloatInit(FloatAllocator(result));
Int scale = IntInit(FloatAllocator(result));
Int scaled = IntInit(FloatAllocator(result));
ValidateFloat(result);- In
Int.Type.c:17:
bool test_int_init(void) {
WriteFmt("Testing IntInit\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Int.Type.c:21:
DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(&alloc.base);
bool result = IntIsZero(&value);- In
Int.Type.c:81:
alloc.base.retry_limit = 5;
Int original = IntInit(&alloc);
BitVecPush(&original.bits, true);- In
Int.Type.c:121:
Int a = IntFrom(255, &alloc.base);
Int b = IntFrom(1, &alloc.base);
Int sum = IntInit(&alloc.base);
IntAdd(&sum, &a, &b);
Int parsed = IntFromBinary("10a1", ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromBinary(&value, "10a1");
Int parsed = IntFromStr("12x3", ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromStr(&value, "12x3");
Int parsed = IntFromHexStr("12g3", ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromHexStr(&value, "12g3");
Int parsed = IntFromStrRadix("102", 2, ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromStrRadix(&value, "102", 2);
Int parsed = IntFromStrRadix("10", 1, ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromStrRadix(&value, "10", 1); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
IntTryFromBinary(&value, (Zstr)NULL);
IntDeinit(&value); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
IntTryFromStr(&value, (Zstr)NULL);
IntDeinit(&value); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
IntTryFromStrRadix(&value, (Zstr)NULL, 10);
IntDeinit(&value); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
IntTryFromOctStr(&value, (Zstr)NULL);
IntDeinit(&value); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
IntTryFromHexStr(&value, (Zstr)NULL);
IntDeinit(&value); Int a = IntFrom((u64)13u, &alloc.base);
Int b = IntFrom((u64)21u, &alloc.base);
Int product = IntInit(&alloc.base);
bool ok = IntMul(&product, &a, &b); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool result = !IntTryFromStrRadix(&value, "_", 10); DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool ok = IntTryFromStrRadix(&value, "7", 10);
bool result = ok && (IntToU64(&value) == 7); DefaultAllocator alloc = DefaultAllocatorInit();
Int valid = IntInit(ALLOCATOR_OF(&alloc));
Int invalid = IntInit(ALLOCATOR_OF(&alloc));
Int valid = IntInit(ALLOCATOR_OF(&alloc));
Int invalid = IntInit(ALLOCATOR_OF(&alloc));
bool ok_valid = IntTryFromStrRadix(&valid, "5", 10);
Str text = StrInitFromZstr("0b101", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_binary_str(&out, &text);
bool result = ok && (IntToU64(&out) == 5u);
Str text = StrInitFromZstr("0B101", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_binary_str(&out, &text);
bool result = ok && (IntToU64(&out) == 5u);
Str text = StrInitFromZstr("1101", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_binary_str(&out, &text);
bool result = ok && (IntToU64(&out) == 13u);
Str text = StrInitFromZstr("0o17", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_oct_str_str(&out, &text);
bool result = ok && (IntToU64(&out) == 15u);
Str text = StrInitFromZstr("0O17", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_oct_str_str(&out, &text);
bool result = ok && (IntToU64(&out) == 15u);
Str text = StrInitFromZstr("17", &alloc);
Int out = IntInit(&alloc.base);
bool ok = int_try_from_oct_str_str(&out, &text);
bool result = ok && (IntToU64(&out) == 15u); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromStrRadix(&out, "AZ", 36); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromStrRadix(&out, "FF", 16);
Str text = StrInitFromZstr("123", &alloc);
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromStr(&out, &text);
Str text = StrInitFromZstr("+5", &alloc);
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromStr(&out, &text);
Str digits = StrInitFromZstr("123", ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool ok = IntTryFromStrRadix(&value, &digits, 10);
Str digits = StrInitFromZstr("+5", ALLOCATOR_OF(&alloc));
Int value = IntInit(ALLOCATOR_OF(&alloc));
bool ok = IntTryFromStrRadix(&value, &digits, 10); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
const char *text = "+5"; DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
const char *text = "42"; DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool ok = IntTryFromStrRadix(&out, "+5", (u8)10); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool ok = IntTryFromOctStr(&out, "17"); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool ok = IntTryFromOctStr(&out, "017"); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromBinary(&out, "0c1"); DefaultAllocator alloc = DefaultAllocatorInit();
Int out = IntInit(&alloc.base);
bool parsed = IntTryFromBinary(&out, "0b101");
Str hex = StrInitFromZstr("ff", &alloc.base);
Int value = IntInit(&alloc.base);
bool ok = int_try_from_hex_str_str(&value, &hex);
Str hex = StrInitFromZstr("12g3", &alloc.base);
Int value = IntInit(&alloc.base);
bool ok = int_try_from_hex_str_str(&value, &hex);- In
Io.Write.c:3819:
Allocator *alloc_base = ALLOCATOR_OF(&alloc);
Int oct = IntInit(alloc_base);
Zstr z = "78";- In
Io.Write.c:4404:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "9z";
StrReadFmt(z, "{}", v);- In
Io.Write.c:4421:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "5";
StrReadFmt(z, "{}", v);- In
Io.Write.c:4437:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "+8";
StrReadFmt(z, "{}", v);- In
Io.Write.c:4501:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "ff";
StrReadFmt(z, "{x}", v);- In
Io.Write.c:4544:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "101";
StrReadFmt(z, "{b}", v);- In
Io.Write.c:4587:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = "17";
StrReadFmt(z, "{o}", v);- In
Io.Write.c:4602:
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(ALLOCATOR_OF(&alloc));
Zstr z = " 42";
StrReadFmt(z, "{}", v);- In
Float.Leak.c:90:
Float v = FloatFromStr("1e3", &dbg.base); // exponent 3 > 0 -> pow10
Int r = IntInit(&dbg.base);
bool ok = FloatToInt(&r, &v); // drives float_pow10 + success path
- In
Io.Blind.c:1245:
static bool test_read_int_plain(void) {
DebugAllocator dbg = DebugAllocatorInit();
Int v = IntInit(&dbg.base);
Zstr z = "12345";
StrReadFmt(z, "{}", v);- In
Io.Blind.c:1260:
static bool test_read_int_leading_plus(void) {
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(&alloc.base);
Zstr z = "+99";
StrReadFmt(z, "{}", v);- In
Io.Blind.c:1276:
static bool test_read_int_hex_plain(void) {
DefaultAllocator alloc = DefaultAllocatorInit();
Int v = IntInit(&alloc.base);
Zstr z = "ff";
StrReadFmt(z, "{x}", v); DefaultAllocator alloc = DefaultAllocatorInit();
Int zero = IntInit(&alloc.base);
int cmp = int_compare_i64(&zero, (i64)0);- In
Int.Leak.c:39:
Int x = IntFrom(123456u, a);
Int y = IntFrom(7891011u, a);
Int r = IntInit(a);
bool ok = IntMul(&r, &x, &y);- In
Int.Leak.c:338:
u64 rem = 0;
{
Int q = IntInit(a);
rem = int_div_u64_rem(&q, &v, 1000u);
IntDeinit(&q);
Float value = FloatFromStr("1234500e-2", ALLOCATOR_OF(&alloc));
Int result_value = IntInit(ALLOCATOR_OF(&alloc));
Str text = StrInit(ALLOCATOR_OF(&alloc));- In
Float.Type.c:175:
Float neg = FloatFromStr("-5", &alloc.base);
Int out = IntInit(&alloc.base);
bool ok = (FloatToInt(&out, &neg) == false);- In
Float.Type.c:207:
.exponent = -1,
};
Int result = IntInit(&alloc.base);
bool ok = FloatToInt(&result, &value);- In
Float.Type.c:228:
Float value = FloatFromStr("120", &alloc.base);
Int result = IntInit(&alloc.base);
bool ok = FloatToInt(&result, &value);- In
Float.Type.c:267:
Float value = FloatFromStr("-7", &alloc.base);
Int result = IntInit(&alloc.base);
bool ok = FloatToInt(&result, &value);- In
Int.Access.c:60:
DefaultAllocator alloc = DefaultAllocatorInit();
Int zero = IntInit(&alloc.base);
Int non_zero = IntFrom(1, &alloc.base);- In
Int.Access.c:149:
Int value = IntFromBinary("1010000", &alloc.base);
Int zero = IntInit(&alloc.base);
bool result = IntTrailingZeroCount(&value) == 4;- In
Int.Access.c:168:
Int power = IntFrom(1, &alloc.base);
Int other = IntFrom(24, &alloc.base);
Int zero = IntInit(&alloc.base);
IntShiftLeft(&power, 20);- In
Int.Access.c:190:
DefaultAllocator alloc = DefaultAllocatorInit();
Int value = IntInit(&alloc.base);
bool error = false;- In
Int.Access.c:357:
Int base = IntFrom(7, &alloc.base);
Int mod = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntPowMod(&result_value, &base, 20u, &mod);- In
Int.Math.c:104:
Int a = IntFrom(255, &alloc.base);
Int b = IntFrom(1, &alloc.base);
Int result_value = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:128:
Int base = IntFrom(40, &alloc.base);
Int rhs = IntFrom(2, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int huge = IntFromStr("123456789012345678901234567890", &alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:161:
Int a = IntFrom(256, &alloc.base);
Int b = IntFrom(1, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool result = IntSub(&result_value, &a, &b);- In
Int.Math.c:180:
Int base = IntFrom(40, &alloc.base);
Int rhs = IntFrom(2, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int preserved = IntFrom(99, &alloc.base);
Int huge = IntFromStr("12345678901234567890", &alloc.base);- In
Int.Math.c:237:
Int a = IntFrom(21, &alloc.base);
Int b = IntFrom(6, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntMul(&result_value, &a, &b);- In
Int.Math.c:256:
Int value = IntFromStr("12345678901234567890", &alloc.base);
Int result_value = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:278:
Int a = IntFrom(0, &alloc.base);
Int b = IntFrom(12345, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntMul(&result_value, &a, &b);- In
Int.Math.c:298:
Int value = IntFrom(12345, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntSquare(&result_value, &value);- In
Int.Math.c:317:
Int base = IntFrom(7, &alloc.base);
Int exponent = IntFrom(20, &alloc.base);
Int result_value = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:343:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:344:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:367:
Int dividend = IntFrom(126, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntDiv(&result_value, ÷nd, 10u);- In
Int.Math.c:385:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int result_value = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:424:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:425:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:448:
Int dividend = IntFrom(126, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntMod(&result_value, ÷nd, 10u);- In
Int.Math.c:466:
Int value = IntFromStr("12345678901234567890", &alloc.base);
Int remainder = IntInit(&alloc.base);
IntMod(&remainder, &value, 97u);- In
Int.Math.c:484:
Int a = IntFrom(48, &alloc.base);
Int b = IntFrom(18, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntGCD(&result_value, &a, &b);- In
Int.Math.c:504:
Int a = IntFrom(21, &alloc.base);
Int b = IntFrom(6, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntLCM(&result_value, &a, &b);- In
Int.Math.c:523:
Int value = IntFrom(4096, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntRoot(&result_value, &value, 4);- In
Int.Math.c:541:
Int value = IntFrom(200, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:542:
Int value = IntFrom(200, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
IntRootRem(&root, &remainder, &value, 3);- In
Int.Math.c:562:
Int value = IntFrom(200, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntSqrt(&result_value, &value);- In
Int.Math.c:580:
Int value = IntFrom(200, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:581:
Int value = IntFrom(200, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
IntSqrtRem(&root, &remainder, &value);- In
Int.Math.c:660:
Int value = IntFrom(12345, &alloc.base);
Int mod = IntFrom(97, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntSquareMod(&result_value, &value, &mod);- In
Int.Math.c:681:
Int b = IntFrom(250, &alloc.base);
Int m = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntModAdd(&result_value, &a, &b, &m);- In
Int.Math.c:703:
Int b = IntFrom(9, &alloc.base);
Int m = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntModSub(&result_value, &a, &b, &m);- In
Int.Math.c:725:
Int b = IntFrom(456, &alloc.base);
Int m = IntFrom(97, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntModMul(&result_value, &a, &b, &m);- In
Int.Math.c:747:
Int b = IntFrom(3, &alloc.base);
Int m = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:748:
Int m = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModDiv(&result_value, &a, &b, &m);- In
Int.Math.c:772:
Int base = IntFrom(7, &alloc.base);
Int mod = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntPowMod(&result_value, &base, 20u, &mod);- In
Int.Math.c:793:
Int exp = IntFrom(13, &alloc.base);
Int mod = IntFrom(497, &alloc.base);
Int result_value = IntInit(&alloc.base);
IntPowMod(&result_value, &base, &exp, &mod);- In
Int.Math.c:814:
Int value = IntFrom(3, &alloc.base);
Int mod = IntFrom(11, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:815:
Int mod = IntFrom(11, &alloc.base);
Int result_value = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModInv(&result_value, &value, &mod);- In
Int.Math.c:838:
Int value = IntFrom(10, &alloc.base);
Int mod = IntFrom(13, &alloc.base);
Int root = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:839:
Int mod = IntFrom(13, &alloc.base);
Int root = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:895:
Int value = IntFromStr("1000000000", &alloc.base);
Int next = IntInit(&alloc.base);
Str text = StrInit(&alloc.base);- In
Int.Math.c:979:
Int dividend = IntFrom(1, &alloc.base);
Int divisor = IntInit(&alloc.base);
Int quotient = IntFrom(99, &alloc.base);
Int remainder = IntFrom(77, &alloc.base);- In
Int.Math.c:1057:
Int a = IntFrom(10, &alloc.base);
Int b = IntFrom(3, &alloc.base);
Int m = IntInit(&alloc.base);
Int result_value = IntFrom(99, &alloc.base);- In
Int.Math.c:1098:
Int base = IntFrom(2, &alloc.base);
Int mod = IntInit(&alloc.base);
Int result_value = IntInit(&alloc.base);- In
Int.Math.c:1099:
Int base = IntFrom(2, &alloc.base);
Int mod = IntInit(&alloc.base);
Int result_value = IntInit(&alloc.base);
IntPowMod(&result_value, &base, 8u, &mod);- In
Int.Math.c:1113:
Int base = IntFrom(2, &alloc.base);
Int exp = IntFrom(8, &alloc.base);
Int mod = IntInit(&alloc.base);
Int result_value = IntFrom(99, &alloc.base);- In
Int.Math.c:1141:
Int mod = IntFrom(7, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1198:
Int mod = IntFrom(17, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1228:
Int mod = IntFrom(17, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1258:
Int mod = IntFrom(97, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1287:
Int mod = IntFrom(257, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1313:
Int mod = IntFrom(13, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1473:
Int value = IntFrom(4, &alloc.base);
Int mod = IntInit(&alloc.base);
Int root = IntFrom(99, &alloc.base);- In
Int.Math.c:1499:
Int mod = IntFrom(7, &alloc.base);
Int root = IntFrom(99, &alloc.base);
Int check = IntInit(&alloc.base);
bool result = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:1530:
Int a = IntFrom((u64)123456789u, &alloc.base);
Int b = IntFrom((u64)987654321u, &alloc.base);
Int product = IntInit(&alloc.base);
bool ok = IntMul(&product, &a, &b);- In
Int.Math.c:1554:
Int a = IntFrom((u64)999u, &alloc.base);
Int zero = IntInit(&alloc.base);
Int product = IntInit(&alloc.base);- In
Int.Math.c:1555:
Int a = IntFrom((u64)999u, &alloc.base);
Int zero = IntInit(&alloc.base);
Int product = IntInit(&alloc.base);
bool ok = IntMul(&product, &a, &zero);- In
Int.Math.c:1596:
Int base = IntFrom(7, &alloc.base);
Int result = IntInit(&alloc.base);
// exponent 0 -> 1 (loop body never runs)
- In
Int.Math.c:1656:
Int b = IntFrom(8, &alloc.base);
Int result = IntInit(&alloc.base);
IntGCD(&result, NULL, &b);- In
Int.Math.c:1677:
Int a = IntFrom(12, &alloc.base);
Int result = IntInit(&alloc.base);
IntGCD(&result, &a, NULL);- In
Int.Math.c:1754:
Int a = IntFrom(4, &alloc.base);
Int b = IntFrom(1, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntSub(&result_value, &a, &b);- In
Int.Math.c:1816:
DefaultAllocator alloc = DefaultAllocatorInit();
Int quotient = IntInit(&alloc.base);
int_div_u64_rem("ient, NULL, 7);- In
Int.Math.c:1920:
Int ones = IntFromBinary("1111111", &alloc.base); // 127
Int one = IntFrom(1u, &alloc.base);
Int sum = IntInit(&alloc.base);
IntAdd(&sum, &ones, &one);- In
Int.Math.c:1970:
Int value = IntFrom(10000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:1971:
Int value = IntFrom(10000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntRootRem(&root, &remainder, &value, 2);- In
Int.Math.c:1993:
Int value = IntFrom(1000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:1994:
Int value = IntFrom(1000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntRootRem(&root, &remainder, &value, 3);- In
Int.Math.c:2017:
Int value = IntFrom(1001, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2018:
Int value = IntFrom(1001, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntRootRem(&root, &remainder, &value, 3);- In
Int.Math.c:2040:
Int value = IntFrom(999, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2041:
Int value = IntFrom(999, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntRootRem(&root, &remainder, &value, 3);- In
Int.Math.c:2063:
Int value = IntFrom(1000000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2064:
Int value = IntFrom(1000000, &alloc.base);
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntRootRem(&root, &remainder, &value, 4);- In
Int.Math.c:2095:
Int base = IntFrom(7, &alloc.base);
Int exp = IntFrom(5, &alloc.base);
Int power = IntInit(&alloc.base);
// 7**5 == 16807.
- In
Int.Math.c:2152:
Int dividend = IntFrom(1000, &alloc.base);
Int quotient = IntInit(&alloc.base);
// 1000 / 7 == 142 (floor).
- In
Int.Math.c:2198:
Int dividend = IntFrom(1001, &alloc.base);
Int quotient = IntInit(&alloc.base);
// 1001 / 7 == 143 exactly.
- In
Int.Math.c:2414:
Int dividend = IntFrom(123456789, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = int_div_exact_u64(&result_value, ÷nd, 3u);- In
Int.Math.c:2438:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:2439:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:2468:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:2469:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
Str qtext = StrInit(&alloc.base);- In
Int.Math.c:2500:
Int dividend = IntFromStr("12345678901234567890", &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = int_mod_i64_into(&result_value, ÷nd, (i64)13);- In
Int.Math.c:2528:
Int base = IntFrom(7, &alloc.base);
Int modulus = IntFrom(1000000007, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = int_pow_i64_mod(&result_value, &base, (i64)13, &modulus);- In
Int.Math.c:2555:
Int base = IntFrom(7, &alloc.base);
Int modulus = IntFrom(1000000007, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = int_pow_i64_mod(&result_value, &base, (i64)0, &modulus);- In
Int.Math.c:2579:
Int value = IntFrom(4096, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntRoot(&result_value, &value, 4);- In
Int.Math.c:2605:
DefaultAllocator alloc = DefaultAllocatorInit();
Int zero = IntInit(&alloc.base);
bool result = (IntIsOdd(&zero) == false);- In
Int.Math.c:2627:
Int dividend = IntFrom((u64)100u, &alloc.base);
Int result = IntInit(&alloc.base);
bool ok = IntMod(&result, ÷nd, (unsigned long)7u);- In
Int.Math.c:2703:
Int value = IntFrom(3, &alloc.base);
Int mod = IntFrom(11, &alloc.base);
Int result = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:2704:
Int mod = IntFrom(11, &alloc.base);
Int result = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool ok = IntModInv(&result, &value, &mod);- In
Int.Math.c:2737:
Int value = IntFrom(5, &alloc.base);
Int mod = IntFrom(11, &alloc.base);
Int result = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:2738:
Int mod = IntFrom(11, &alloc.base);
Int result = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool ok = IntModInv(&result, &value, &mod);- In
Int.Math.c:2808:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
bool ok = IntDivExact("ient, ÷nd, 10u);- In
Int.Math.c:2825:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
bool ok = IntDivExact("ient, ÷nd, (i64)10);- In
Int.Math.c:2845:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2846:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntDivMod("ient, &remainder, ÷nd, 0u);- In
Int.Math.c:2864:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2865:
Int dividend = IntFrom(127, &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntDivMod("ient, &remainder, ÷nd, (i64)0);- In
Int.Math.c:2886:
Int dividend = IntFrom(127, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntMod(&result_value, ÷nd, 0u);- In
Int.Math.c:2903:
Int dividend = IntFrom(127, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntMod(&result_value, ÷nd, (i64)0);- In
Int.Math.c:2928:
IntShiftLeft(&value, 50); // 2^50
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:2929:
Int root = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = IntSqrtRem(&root, &remainder, &value);- In
Int.Math.c:2977:
Int value = IntFrom(2, &alloc.base);
Int mod = IntFrom(17, &alloc.base);
Int root = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);- In
Int.Math.c:2978:
Int mod = IntFrom(17, &alloc.base);
Int root = IntInit(&alloc.base);
Int check = IntInit(&alloc.base);
bool ok = IntModSqrt(&root, &value, &mod);- In
Int.Math.c:3147:
Int dividend = IntFromStr("12345678901234567890123456789", &alloc.base);
Int divisor = IntFromStr("987654321987654321", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:3148:
Int divisor = IntFromStr("987654321987654321", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = int_div_mod("ient, &remainder, ÷nd, &divisor);- In
Int.Math.c:3182:
Int dividend = IntFromStr("1000000007", &alloc.base);
Int divisor = IntFromStr("97", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:3183:
Int divisor = IntFromStr("97", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = int_div_mod("ient, &remainder, ÷nd, &divisor);- In
Int.Math.c:3211:
Int dividend = IntFromStr("11975308533", &alloc.base);
Int divisor = IntFromStr("97", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:3212:
Int divisor = IntFromStr("97", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = int_div_mod("ient, &remainder, ÷nd, &divisor);- In
Int.Math.c:3239:
Int dividend = IntFromStr("42", &alloc.base);
Int divisor = IntFromStr("1000", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:3240:
Int divisor = IntFromStr("1000", &alloc.base);
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = int_div_mod("ient, &remainder, ÷nd, &divisor);- In
Int.Math.c:3267:
Int dividend = IntFromStr("12345", &alloc.base);
Int divisor = IntInit(&alloc.base); /* zero */
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);- In
Int.Math.c:3268:
Int divisor = IntInit(&alloc.base); /* zero */
Int quotient = IntInit(&alloc.base);
Int remainder = IntInit(&alloc.base);
bool ok = int_div_mod("ient, &remainder, ÷nd, &divisor);- In
Int.Math.c:3292:
Int dividend = IntFromStr("100", &alloc.base);
Int divisor = IntFromStr("7", &alloc.base);
Int remainder = IntInit(&alloc.base);
/* Must abort inside int_div_mod via ValidateInt(quotient). */- In
Int.Math.c:3314:
Int dividend = IntFromStr("100", &alloc.base);
Int divisor = IntFromStr("7", &alloc.base);
Int quotient = IntInit(&alloc.base);
/* Must abort inside int_div_mod via ValidateInt(remainder). */- In
Int.Math.c:3376:
Int exp = IntFrom(13, &alloc.base);
Int mod = IntFrom(497, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = int_pow_mod(&result_value, &base, &exp, &mod);- In
Int.Math.c:3397:
Int exp = IntFrom(987654321u, &dbg.base); // many set bits + bits
Int mod = IntFrom(1000000007u, &dbg.base);
Int result_value = IntInit(&dbg.base);
bool ok = int_pow_mod(&result_value, &base, &exp, &mod);- In
Int.Math.c:3427:
Int value = IntFrom(0, &alloc.base);
Int next = IntInit(&alloc.base);
bool ok = IntNextPrime(&next, &value);- In
Int.Math.c:3455:
Int value = IntFrom(10, &alloc.base);
Int next = IntInit(&alloc.base);
bool ok = IntNextPrime(&next, &value);- In
Int.Math.c:3478:
Int value = IntFrom(9, &alloc.base);
Int next = IntInit(&alloc.base);
bool ok = IntNextPrime(&next, &value);- In
Int.Math.c:3523:
Int b = IntFrom(5, &alloc.base);
Int m = IntFrom(13, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntModSub(&result_value, &a, &b, &m);- In
Int.Math.c:3569:
Int base = IntFrom(3, &alloc.base);
Int mod = IntFrom(17, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntPowMod(&result_value, &base, 13u, &mod);- In
Int.Math.c:3591:
Int base = IntFrom(123456789, &alloc.base);
Int mod = IntFrom(1000000007, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntPowMod(&result_value, &base, 0u, &mod);- In
Int.Math.c:3615:
Int base = IntFrom(2, &alloc.base);
Int mod = IntFrom(1000000007, &alloc.base);
Int result_value = IntInit(&alloc.base);
bool ok = IntPowMod(&result_value, &base, 64u, &mod);- In
Int.Math.c:3649:
DefaultAllocator alloc = DefaultAllocatorInit();
Int result_value = IntInit(&alloc.base);
Int mod = IntFrom(7, &alloc.base);- In
Int.Math.c:3664:
DefaultAllocator alloc = DefaultAllocatorInit();
Int result_value = IntInit(&alloc.base);
Int base = IntFrom(2, &alloc.base);- In
Io.Read.c:914:
bool success = true;
Int dec = IntInit(alloc_base);
Int hex = IntInit(alloc_base);
Int bin = IntInit(alloc_base);- In
Io.Read.c:915:
Int dec = IntInit(alloc_base);
Int hex = IntInit(alloc_base);
Int bin = IntInit(alloc_base);
Int oct = IntInit(alloc_base);- In
Io.Read.c:916:
Int dec = IntInit(alloc_base);
Int hex = IntInit(alloc_base);
Int bin = IntInit(alloc_base);
Int oct = IntInit(alloc_base);- In
Io.Read.c:917:
Int hex = IntInit(alloc_base);
Int bin = IntInit(alloc_base);
Int oct = IntInit(alloc_base);
Str dec_text = StrInit(&alloc);
Last updated on