Fix double promotion in target rtexif

This commit is contained in:
Ingo Weyrich
2020-01-20 16:02:30 +01:00
parent 6d76670e7d
commit 544a2e5068
6 changed files with 11 additions and 11 deletions

View File

@@ -1391,9 +1391,9 @@ public:
std::string toString (const Tag* t) const override
{
int a = t->toInt (0, BYTE);
float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2));
double b = static_cast<float>(10 * (a >> 2)) * std::pow(4.f, static_cast<float>((a & 0x03) - 2));
if (b > 1.f) {
if (b > 1.0) {
char buffer[32];
sprintf (buffer, "%.2f", b );
return buffer;
@@ -1404,9 +1404,9 @@ public:
double toDouble (const Tag* t, int ofs) override
{
int a = t->toInt (ofs, BYTE);
float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2));
double b = static_cast<float>(10 * (a >> 2)) * std::pow(4.f, static_cast<float>((a & 0x03) - 2));
if (b > 1.f) {
if (b > 1.0) {
return b;
} else {
return 0.;