blob: 929d74d52fd9d3e25e9e6d4c1a3dd8c67b695230 [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.
// @dart = 2.9
/// @assertion int gcd(int other)
/// Returns the greatest common divisor of this integer and other.
/// ...
/// For any integer x, x.gcd(x) is x.abs().
/// @description Checks that for any integer x, x.gcd(x) is x.abs().
/// @author sgrekhov@unipro.ru
import "../../../Utils/expect.dart";
main() {
Expect.equals(17, (-17).gcd(-17));
}