arithmetic-operations-for/naturals-big-endian

View on GitHub
src/core/array/_validate.js

Summary

Maintainability
A
0 mins
Test Coverage
import assert from 'assert';

export default function _validate(base, a, ai, aj) {
    assert(Number.isInteger(base));
    assert(base >= 2);
    assert(ai >= 0 && aj <= a.length);

    for (; ai < aj; ++ai) {
        const x = a[ai];
        assert(Number.isInteger(x));
        assert(x >= 0 && x <= base - 1);
    }

    return true;
}