openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Inaccuracy in float->Rational conversion


From: Phil Barrett
Subject: [Openexr-devel] Inaccuracy in float->Rational conversion
Date: Mon, 22 May 2017 10:39:02 +0100
User-agent: Opera Mail/12.16 (Linux)

expTime is defined as a float attribute, so 1/50 is stored as 0.0199999996.

I convert to a Rational for convenience of displaying this value, but Imf::Rational(0.0199999996) results in 1/51 - which is clearly a worse approximation that 1/50.

Any ideas?

Phil
--
Phil Barrett
FilmLight



reply via email to

[Prev in Thread] Current Thread [Next in Thread]