Lines Matching +full:int +full:- +full:b
5 * SPDX-License-Identifier: Apache-2.0
10 /* Built-time math test. Zephyr code depends on a standard C ABI with
20 #pragma GCC diagnostic ignored "-Woverflow"
23 /* Two's complement negation check: "-N" must equal "(~N)+1" */
24 #define NEG_CHECK(T, N) BUILD_ASSERT((-((T)N)) == (~((T)N)) + 1)
31 #pragma clang diagnostic ignored "-Winteger-overflow"
34 ROLLOVER_CHECK(unsigned int, 0xffffffff, 0);
40 NEG_CHECK(signed char, -1);
43 ROLLOVER_CHECK(signed char, 127, -128);
47 NEG_CHECK(short, -1);
50 ROLLOVER_CHECK(short, 32767, -32768);
52 NEG_CHECK(int, 1);
53 NEG_CHECK(int, 0);
54 NEG_CHECK(int, -1);
55 NEG_CHECK(int, 0x80000000);
56 NEG_CHECK(int, 0x7fffffff);
57 ROLLOVER_CHECK(int, 2147483647, -2147483648);
81 volatile uint32_t num, a, b; in ZTEST() local
86 zassert_true((bignum == 0xbcdf0509369bf232ULL), "64-bit multiplication failed"); in ZTEST()
89 b = 5872U; in ZTEST()
90 num = a * b; in ZTEST()
91 zassert_true((num == 176160000U), "32-bit multiplication failed"); in ZTEST()
94 b = 98982U; in ZTEST()
95 num = a / b; in ZTEST()
96 zassert_true((num == 2368U), "32-bit division failed"); in ZTEST()