Skip to content

Commit 087f2db

Browse files
committed
Avoid rational in Schoenberg cubic spline kernel
1 parent 3c576ba commit 087f2db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/general/smoothing_kernels.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ struct SchoenbergCubicSplineKernel{NDIMS} <: AbstractSmoothingKernel{NDIMS} end
145145

146146
# We do not use `+=` or `-=` since these are not recognized by MuladdMacro.jl.
147147
# Use `//` to preserve the type of `q`.
148-
result = 1 // 4 * (2 - q)^3
148+
result = 1 * (2 - q)^3 / 4
149149
result = result - (q < 1) * (1 - q)^3
150150

151151
# Zero out result if q >= 2
@@ -160,7 +160,7 @@ end
160160

161161
# We do not use `+=` or `-=` since these are not recognized by MuladdMacro.jl
162162
# Use `//` to preserve the type of `q`.
163-
result = -3 // 4 * (2 - q)^2
163+
result = -3 * (2 - q)^2 / 4
164164
result = result + 3 * (q < 1) * (1 - q)^2
165165

166166
# Zero out result if q >= 2

0 commit comments

Comments
 (0)