Skip to content

Commit 811f856

Browse files
gamplemanjakub-nlx
andauthored
Fixes instability for float interpolator when t=1 (#192)
Co-authored-by: Jakub Hampl <jhampl@amazon.com>
1 parent f15db43 commit 811f856

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Interpolation.elm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ float a to =
191191
b =
192192
to - a
193193
in
194-
\t -> a + b * t
194+
\t ->
195+
if t == 1 then
196+
to
197+
198+
else
199+
a + b * t
195200

196201

197202
{-| Interpolates between ints.

0 commit comments

Comments
 (0)