blob: 6f7d86083b59ede2619dd10d21e22167b7942afe [file] [log] [blame]
/*
* Copyright (c) 2011, 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 num pow(num x, num y)
* If [x] is an int and exponent is a non-negative int, the result is an int,
* otherwise both arguments are converted to doubles first,
* and the result is a double.
* @description Checks that if [x] is an int and [y] is a non-negative int,
* the result is an int.
* @author msyabro
*/
import "../../Utils/expect.dart";
import "dart:math" as Math;
main() {
Expect.isTrue(Math.pow(0, 0) is int);
Expect.isTrue(Math.pow(-5, 0) is int);
Expect.isTrue(Math.pow(100, 0) is int);
Expect.isTrue(Math.pow(1, 1) is int);
Expect.isTrue(Math.pow(1000, 1000) is int);
}