Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8983c9b0 authored by Krzysztof Kosiński's avatar Krzysztof Kosiński Committed by Android (Google) Code Review
Browse files

Merge "Add default constructor to android::half."

parents 42475b7c 91a4df12
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ class half {
    };

public:
    CONSTEXPR half() noexcept { }
    CONSTEXPR half(float v) noexcept : mBits(ftoh(v)) { }
    CONSTEXPR operator float() const noexcept { return htof(mBits); }

+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ TEST_F(HalfTest, Basics) {
    EXPECT_EQ(2UL, sizeof(half));

    // test +/- zero
    EXPECT_EQ(0x0000, half().getBits());
    EXPECT_EQ(0x0000, half( 0.0f).getBits());
    EXPECT_EQ(0x8000, half(-0.0f).getBits());