blob: 8d25de283c06a471311b28907698e4cee2ecaeda [file] [log] [blame]
// Copyright (c) 2013, 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 Int32x4 lessThanOrEqual(Float32x4 other)
/// Relational less than or equal.
/// @description Checks that the returned [Int32x4] contains correct values.
/// @author msyabro
import "dart:typed_data";
import "../../../Utils/expect.dart";
check(op1, op2, expected) {
var res = op1.lessThanOrEqual(op2);
Expect.equals(expected.x, res.x);
Expect.equals(expected.y, res.y);
Expect.equals(expected.z, res.z);
Expect.equals(expected.w, res.w);
}
main() {
check(new Float32x4(.0, .0, .0, .0), new Float32x4(.0, .0, .0, .0),
new Int32x4.bool(true, true, true, true));
check(new Float32x4(-1.0, -1.0, -.02, -1.32), new Float32x4(.0, .0, .0, .0),
new Int32x4.bool(true, true, true, true));
check(new Float32x4(1e-30, 1.23e-40, .02, 1e-10),
new Float32x4(.0, .0, .0, .0),
new Int32x4.bool(false, false, false, false));
check(new Float32x4(1.0, 2.0, 1e-3, .04e-2),
new Float32x4(1.0, 10.0, 1e-2, 0.23e40),
new Int32x4.bool(true, true, true, true));
}