We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76a4b57 commit 5c10f18Copy full SHA for 5c10f18
1 file changed
tools/clang/unittests/HLSLExec/HlslTestDataTypes.h
@@ -113,17 +113,16 @@ struct HLSLHalf_t {
113
Val = DirectX::PackedVector::XMConvertFloatToHalf(F);
114
}
115
HLSLHalf_t(const double D) {
116
- float F = 0.5;
117
- if (D >= std::numeric_limits<float>::max())
+ float F;
+ if (D >= std::numeric_limits<double>::max())
118
F = std::numeric_limits<float>::max();
119
- else if (D <= std::numeric_limits<float>::lowest())
+ else if (D <= std::numeric_limits<double>::lowest())
120
F = std::numeric_limits<float>::lowest();
121
else
122
F = static_cast<float>(D);
123
124
125
126
-
127
HLSLHalf_t(const uint32_t U) {
128
float F = static_cast<float>(U);
129
0 commit comments