fixed

Pure Haskell large fixed-width integers.
git clone git://git.ppad.tech/fixed.git
Log | Files | Refs | README | LICENSE

commit bf231ae5395bf9251f790f304368c5384097ff8b
parent 318cd0eeb92cf38a4e9140f0f297973169b9c1b3
Author: Jared Tobin <jared@jtobin.io>
Date:   Thu, 23 Jan 2025 22:33:34 +0400

lib: fix boundaries

Diffstat:
Mlib/Data/Word/Extended.hs | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Data/Word/Extended.hs b/lib/Data/Word/Extended.hs @@ -497,7 +497,7 @@ quotrem quo u d mr = do dn <- PA.newPrimArray dlen PA.setPrimArray dn 0 dlen 0 let go_dn !j - | j < 0 = pure () + | j == 0 = pure () | otherwise = do let !dj = PA.indexPrimArray d j !dj_1 = PA.indexPrimArray d (j - 1) @@ -518,7 +518,7 @@ quotrem quo u d mr = do PA.writePrimArray un ulen (u_ulen .>>. (64 - shift)) -- duplicated, but easy to handle mutableprimarrays this way let go_un !j - | j < 0 = pure () + | j == 0 = pure () | otherwise = do let !uj = PA.indexPrimArray u j !uj_1 = PA.indexPrimArray u (j - 1)