@@ -67,30 +67,36 @@ to `A[ceil(Int,x)]` without scaling.
6767Constant
6868
6969function positions (c:: Constant{Previous} , ax, x) # discontinuity occurs at integer locations
70- xm = floorbounds (x, ax)
70+ x_value = ForwardDiff. value (ForwardDiff. value (x))
71+ xm = floorbounds (x_value, ax)
7172 δx = x - xm
7273 fast_trunc (Int, xm), δx
7374end
7475function positions (c:: Constant{Next} , ax, x) # discontinuity occurs at integer locations
75- xm = ceilbounds (x, ax)
76+ x_value = ForwardDiff. value (ForwardDiff. value (x))
77+ xm = ceilbounds (x_value, ax)
7678 δx = x - xm
7779 fast_trunc (Int, xm), δx
7880end
7981function positions (c:: Constant{Nearest} , ax, x) # discontinuity occurs at half-integer locations
80- xm = roundbounds (x, ax)
82+ x_value = ForwardDiff. value (ForwardDiff. value (x))
83+ xm = roundbounds (x_value, ax)
8184 δx = x - xm
82- fast_trunc (Int, xm), δx
85+ i = fast_trunc (Int, xm)
86+ i, δx
8387end
8488
8589function positions (c:: Constant{Previous,Periodic{OnCell}} , ax, x)
90+ x_value = ForwardDiff. value (ForwardDiff. value (x))
8691 # We do not use floorbounds because we do not want to add a half at
8792 # the lowerbound to round up.
88- xm = floor (x )
93+ xm = floor (x_value )
8994 δx = x - xm
9095 modrange (fast_trunc (Int, xm), ax), δx
9196end
9297function positions (c:: Constant{Next,Periodic{OnCell}} , ax, x) # discontinuity occurs at integer locations
93- xm = ceilbounds (x, ax)
98+ x_value = ForwardDiff. value (ForwardDiff. value (x))
99+ xm = ceilbounds (x_value, ax)
94100 δx = x - xm
95101 modrange (fast_trunc (Int, xm), ax), δx
96102end
0 commit comments