@@ -2,8 +2,6 @@ VERSION < v"0.7.0-beta2.199" && __precompile__()
2
2
3
3
module FixedPointNumbers
4
4
5
- using Base: reducedim_initarray
6
-
7
5
import Base: == , < , <= , - , + , * , / , ~ , isapprox,
8
6
convert, promote_rule, show, isinteger, abs, decompose,
9
7
isnan, isinf, isfinite,
@@ -154,27 +152,12 @@ sizeof(::Type{T}) where {T <: FixedPoint} = sizeof(rawtype(T))
154
152
155
153
# Promotions for reductions
156
154
const Treduce = Float64
157
- if isdefined (Base, :r_promote )
158
- # Julia v0.6
159
- Base. r_promote (:: typeof (+ ), x:: FixedPoint{T} ) where {T} = Treduce (x)
160
- Base. r_promote (:: typeof (* ), x:: FixedPoint{T} ) where {T} = Treduce (x)
161
- Base. reducedim_init (f:: typeof (identity),
162
- op:: typeof (+ ),
163
- A:: AbstractArray{T} , region) where {T <: FixedPoint } =
164
- Base. reducedim_initarray (A, region, zero (Treduce))
165
- Base. reducedim_init (f:: typeof (identity),
166
- op:: typeof (* ),
167
- A:: AbstractArray{T} , region) where {T <: FixedPoint } =
168
- Base. reducedim_initarray (A, region, oneunit (Treduce))
169
- else
170
- # Julia v0.7
171
- Base. add_sum (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) + Treduce (y)
172
- Base. reduce_empty (:: typeof (Base. add_sum), :: Type{F} ) where {F<: FixedPoint } = zero (Treduce)
173
- Base. reduce_first (:: typeof (Base. add_sum), x:: FixedPoint ) = Treduce (x)
174
- Base. mul_prod (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) * Treduce (y)
175
- Base. reduce_empty (:: typeof (Base. mul_prod), :: Type{F} ) where {F<: FixedPoint } = one (Treduce)
176
- Base. reduce_first (:: typeof (Base. mul_prod), x:: FixedPoint ) = Treduce (x)
177
- end
155
+ Base. add_sum (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) + Treduce (y)
156
+ Base. reduce_empty (:: typeof (Base. add_sum), :: Type{F} ) where {F<: FixedPoint } = zero (Treduce)
157
+ Base. reduce_first (:: typeof (Base. add_sum), x:: FixedPoint ) = Treduce (x)
158
+ Base. mul_prod (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) * Treduce (y)
159
+ Base. reduce_empty (:: typeof (Base. mul_prod), :: Type{F} ) where {F<: FixedPoint } = one (Treduce)
160
+ Base. reduce_first (:: typeof (Base. mul_prod), x:: FixedPoint ) = Treduce (x)
178
161
179
162
180
163
for f in (:div , :fld , :fld1 )
0 commit comments