Use double type to improve floating point accuracy.
This commit is contained in:
parent
79bf4d0b1e
commit
c20ee1a7f5
@ -2612,7 +2612,7 @@ std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*)
|
||||
}
|
||||
std::ostringstream oss;
|
||||
oss.copyfmt(os);
|
||||
const double t = 3600 * value.toFloat(0) + 60 * value.toFloat(1) + value.toFloat(2);
|
||||
const double t = 3600.0 * value.toFloat(0) + 60.0 * value.toFloat(1) + value.toFloat(2);
|
||||
enforce<std::overflow_error>(std::isfinite(t), "Non-finite time value");
|
||||
int p = 0;
|
||||
const double fraction = std::fmod(t, 1);
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user