From 674888fdc90e932cd783a871c5248b79476e6f84 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 23 May 2019 17:18:35 +0300 Subject: [PATCH] lib/decimal: add a comment explaining weird code in maxUpExponent. Fixes #29 --- lib/decimal/decimal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/decimal/decimal.go b/lib/decimal/decimal.go index 11e9eda86..60c1d3005 100644 --- a/lib/decimal/decimal.go +++ b/lib/decimal/decimal.go @@ -186,6 +186,7 @@ func maxUpExponent(v int64) int16 { v = -v } if v < 0 { + // Handle corner case for v=-1<<63 return 0 }