@@ -7,7 +7,7 @@ using Base: reducedim_initarray
77import Base: == , < , <= , - , + , * , / , ~ , isapprox,
88 convert, promote_rule, show, showcompact, isinteger, abs, decompose,
99 isnan, isinf, isfinite,
10- zero, one, typemin, typemax, realmin, realmax, eps, sizeof, reinterpret,
10+ zero, oneunit, one, typemin, typemax, realmin, realmax, eps, sizeof, reinterpret,
1111 float, trunc, round, floor, ceil, bswap,
1212 div, fld, rem, mod, mod1, fld1, min, max, minmax,
1313 start, next, done, r_promote, reducedim_init, rand
@@ -118,7 +118,7 @@ include("fixed.jl")
118118include (" normed.jl" )
119119include (" deprecations.jl" )
120120
121- eps (:: Type{T} ) where {T <: FixedPoint } = T (one (rawtype (T)),0 )
121+ eps (:: Type{T} ) where {T <: FixedPoint } = T (oneunit (rawtype (T)),0 )
122122eps (:: T ) where {T <: FixedPoint } = eps (T)
123123sizeof (:: Type{T} ) where {T <: FixedPoint } = sizeof (rawtype (T))
124124
@@ -134,7 +134,7 @@ reducedim_init(f::typeof(identity),
134134reducedim_init (f:: typeof (identity),
135135 op:: typeof (* ),
136136 A:: AbstractArray{T} , region) where {T <: FixedPoint } =
137- reducedim_initarray (A, region, one (Treduce))
137+ reducedim_initarray (A, region, oneunit (Treduce))
138138
139139for f in (:div , :fld , :fld1 )
140140 @eval begin
@@ -152,12 +152,12 @@ end
152152
153153# When multiplying by a float, reduce two multiplies to one.
154154# Particularly useful for arrays.
155- scaledual (Tdual:: Type , x) = one (Tdual), x
155+ scaledual (Tdual:: Type , x) = oneunit (Tdual), x
156156scaledual (b:: Tdual , x) where {Tdual <: Number } = b, x
157157scaledual (Tdual:: Type , x:: Union{T,AbstractArray{T}} ) where {T <: FixedPoint } =
158- convert (Tdual, 1 / one (T)), reinterpret (rawtype (T), x)
158+ convert (Tdual, 1 / oneunit (T)), reinterpret (rawtype (T), x)
159159scaledual (b:: Tdual , x:: Union{T,AbstractArray{T}} ) where {Tdual <: Number ,T <: FixedPoint } =
160- convert (Tdual, b/ one (T)), reinterpret (rawtype (T), x)
160+ convert (Tdual, b/ oneunit (T)), reinterpret (rawtype (T), x)
161161
162162@noinline function throw_converterror (:: Type{T} , x) where {T <: FixedPoint }
163163 n = 2 ^ (8 * sizeof (T))
0 commit comments