summaryrefslogtreecommitdiff
path: root/zephyr/test/math/src/fixed_point_int_sqrtf.c
blob: d8360ec189c40e3d4e1c2189465b62f08697e6ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Copyright 2022 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <ztest.h>

#include "math.h"
#include "math_util.h"

ZTEST_USER(math, int_sqrtf_negative)
{
	zassert_equal(int_sqrtf(-100), 0, NULL);
}

ZTEST_USER(math, int_sqrtf_overflow)
{
	zassert_equal(int_sqrtf(INT64_MAX), INT32_MAX, NULL);
}