/* * Copyright (c) 2021, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include template void check_cast_both_ways(const A& a, const B& b) { EXPECT_EQ((bit_cast(b)), a); EXPECT_EQ((bit_cast(a)), b); } TEST_CASE(double_int_conversion) { check_cast_both_ways(static_cast(0), 0.0); check_cast_both_ways(static_cast(1) << 63, -0.0); check_cast_both_ways(static_cast(0x4172f58bc0000000), 19880124.0); } TEST_MAIN(BitCast)