IntRoot
IntRoot
Description
Compute the integer degree-th root of a value.
Parameters
| Name | Direction | Description |
|---|---|---|
result |
out | Destination for the root |
value |
in | Input value |
degree |
in | Root degree |
Usage example (from documentation)
IntRoot(&root, &value, 3);Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1263:
}
void IntRoot(Int *result, Int *value, u64 degree) {
Int root = IntInit();
Int remainder = IntInit();- In
Int.c:1277:
void IntSqrt(Int *result, Int *value) {
IntRoot(result, value, 2);
}- In
Int.Math.c:453:
bool test_int_root(void) {
WriteFmt("Testing IntRoot\n");
Int value = IntFrom(4096);- In
Int.Math.c:458:
Int result_value = IntInit();
IntRoot(&result_value, &value, 4);
bool result = IntToU64(&result_value) == 8;- In
Int.Math.c:852:
bool test_int_root_zero_degree(void) {
WriteFmt("Testing IntRoot zero-degree handling\n");
Int value = IntFrom(16);
Last updated on