blob: a63046d7d4ce96ee3b4198af5f3d3309a5d37088 [file] [log] [blame]
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* @assertion int modPow(int exponent, int modulus)
* Returns this integer to the power of exponent modulo modulus.
* The exponent must be non-negative and modulus must be positive.
* @description Checks that the exponent must be non-negative and modulus must
* be positive.
* @author sgrekhov@unipro.ru
*/
import "../../../Utils/expect.dart";
main() {
Expect.throws(() {3.modPow(-11, 4);}, (e) => e is RangeError);
Expect.throws(() {3.modPow(11, -4);}, (e) => e is RangeError);
Expect.throws(() {3.modPow(11, 0);}, (e) => e is RangeError);
}