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

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

#include <zephyr/ztest.h>

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

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