@@ -154,27 +154,12 @@ sizeof(::Type{T}) where {T <: FixedPoint} = sizeof(rawtype(T))
154
154
155
155
# Promotions for reductions
156
156
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
157
+ Base. add_sum (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) + Treduce (y)
158
+ Base. reduce_empty (:: typeof (Base. add_sum), :: Type{F} ) where {F<: FixedPoint } = zero (Treduce)
159
+ Base. reduce_first (:: typeof (Base. add_sum), x:: FixedPoint ) = Treduce (x)
160
+ Base. mul_prod (x:: FixedPoint , y:: FixedPoint ) = Treduce (x) * Treduce (y)
161
+ Base. reduce_empty (:: typeof (Base. mul_prod), :: Type{F} ) where {F<: FixedPoint } = one (Treduce)
162
+ Base. reduce_first (:: typeof (Base. mul_prod), x:: FixedPoint ) = Treduce (x)
178
163
179
164
180
165
for f in (:div , :fld , :fld1 )
0 commit comments