Skip to content

IntSqrtRem

IntSqrtRem

Description

Compute the integer square root and remainder.

Parameters

Name Direction Description
root out Destination for the root
remainder out Destination for the remainder
value in Input value

Usage example (from documentation)

  IntSqrtRem(&root, &rem, &value);

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    void IntSqrtRem(Int *root, Int *remainder, Int *value) {
        IntRootRem(root, remainder, value, 2);
    }
        bool result   = false;
    
        IntSqrtRem(&root, &remainder, value);
        result = IntIsZero(&remainder);
    
    bool test_int_sqrt_rem(void) {
        WriteFmt("Testing IntSqrtRem\n");
    
        Int value = IntFrom(200);
        Int remainder = IntInit();
    
        IntSqrtRem(&root, &remainder, &value);
    
        bool result = IntToU64(&root) == 14;
Last updated on