mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-18 07:18:29 +08:00
Fix round to round half-cases to even (#482)
This commit is contained in:

committed by
GitHub

parent
135fd796d2
commit
90c234b7ac
@@ -957,7 +957,7 @@ TEST_CASE("test arithmetic unary ops") {
|
||||
// Test round
|
||||
{
|
||||
array x({0.5, -0.5, 1.5, -1.5, 2.3, 2.6});
|
||||
CHECK(array_equal(round(x), array({1, -1, 2, -2, 2, 3})).item<bool>());
|
||||
CHECK(array_equal(round(x), array({0, -0, 2, -2, 2, 3})).item<bool>());
|
||||
|
||||
x = array({11, 222, 32});
|
||||
CHECK(array_equal(round(x, -1), array({10, 220, 30})).item<bool>());
|
||||
|
Reference in New Issue
Block a user