summaryrefslogtreecommitdiff
path: root/tools/source/generic
diff options
context:
space:
mode:
Diffstat (limited to 'tools/source/generic')
-rw-r--r--tools/source/generic/fract.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index 3a8eb09822c8..8ec17b94a477 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -104,6 +104,10 @@ Fraction::operator double() const
return 0.0;
}
+ // https://github.com/boostorg/boost/issues/335 when these are std::numeric_limits<sal_Int32>::min
+ if (mnNumerator == mnDenominator)
+ return 1.0;
+
return boost::rational_cast<double>(toRational(mnNumerator, mnDenominator));
}