use exact float comparison in number formatter for now

This commit is contained in:
Thomas Fussell 2016-11-27 17:06:00 +01:00
parent fecd239fcf
commit 5d1d1d43bc

View File

@ -176,9 +176,9 @@ bool format_condition::satisfied_by(long double number) const
case condition_type::less_than: case condition_type::less_than:
return number < value; return number < value;
case condition_type::not_equal: case condition_type::not_equal:
return std::fabs(number - value) >= std::numeric_limits<long double>::min(); return std::fabs(number - value) != 0.0L;
case condition_type::equal: case condition_type::equal:
return std::fabs(number - value) < std::numeric_limits<long double>::min(); return std::fabs(number - value) == 0.0L;
#ifdef WIN32 #ifdef WIN32
default: default:
throw xlnt::exception("unhandled"); throw xlnt::exception("unhandled");