diff --git a/sycl/include/sycl/stream.hpp b/sycl/include/sycl/stream.hpp index 1207d212bb3f..761767ae75c4 100644 --- a/sycl/include/sycl/stream.hpp +++ b/sycl/include/sycl/stream.hpp @@ -265,14 +265,14 @@ EnableIfFP floatingPointToDecStr(T AbsVal, char *Digits, int Exp = 0; // For the case that the value is larger than 10.0 - while (AbsVal >= 10.0) { + while (AbsVal >= T{10.0}) { ++Exp; - AbsVal /= 10.0; + AbsVal /= T{10.0}; } // For the case that the value is less than 1.0 - while (AbsVal > 0.0 && AbsVal < 1.0) { + while (AbsVal > T{0.0} && AbsVal < T{1.0}) { --Exp; - AbsVal *= 10.0; + AbsVal *= T{10.0}; } auto IntegralPart = static_cast(AbsVal); @@ -292,7 +292,7 @@ EnableIfFP floatingPointToDecStr(T AbsVal, char *Digits, FractionLength = MAX_FLOATING_POINT_DIGITS - 5; for (unsigned I = 0; I < FractionLength; ++I) { - FractionPart *= 10.0; + FractionPart *= T{10.0}; FractionDigits[I] = static_cast(FractionPart); FractionPart -= static_cast(FractionPart); }