GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 8 / 0 / 10
Functions: 75.0% 3 / 1 / 5
Branches: -% 0 / 0 / 0
Decisions: -% 0 / - / 0

firmware/util/math/efi_ratio.h
Line Branch Decision Exec Source
1 #pragma once
2
3 namespace efi {
4
5 template <int TNum, int TDenom = 1>
6 struct ratio {
7 static constexpr int num = TNum;
8 static constexpr int den = TDenom;
9
10 // A ratio type representing the reciprocal of this type.
11 using recip = ratio<den, num>;
12
13 7991 static constexpr float asFloat() {
14 7991 return (float)num / den;
15 }
16 };
17
18 } // namespace efi
19