@@ -7,7 +7,7 @@ using Base: reducedim_initarray
7
7
import Base: == , < , <= , - , + , * , / , ~ , isapprox,
8
8
convert, promote_rule, show, showcompact, isinteger, abs, decompose,
9
9
isnan, isinf, isfinite,
10
- zero, one, typemin, typemax, realmin, realmax, eps, sizeof, reinterpret,
10
+ zero, oneunit, one, typemin, typemax, realmin, realmax, eps, sizeof, reinterpret,
11
11
float, trunc, round, floor, ceil, bswap,
12
12
div, fld, rem, mod, mod1, fld1, min, max, minmax,
13
13
start, next, done, r_promote, reducedim_init, rand
@@ -118,7 +118,7 @@ include("fixed.jl")
118
118
include (" normed.jl" )
119
119
include (" deprecations.jl" )
120
120
121
- eps (:: Type{T} ) where {T <: FixedPoint } = T (one (rawtype (T)),0 )
121
+ eps (:: Type{T} ) where {T <: FixedPoint } = T (oneunit (rawtype (T)),0 )
122
122
eps (:: T ) where {T <: FixedPoint } = eps (T)
123
123
sizeof (:: Type{T} ) where {T <: FixedPoint } = sizeof (rawtype (T))
124
124
@@ -134,7 +134,7 @@ reducedim_init(f::typeof(identity),
134
134
reducedim_init (f:: typeof (identity),
135
135
op:: typeof (* ),
136
136
A:: AbstractArray{T} , region) where {T <: FixedPoint } =
137
- reducedim_initarray (A, region, one (Treduce))
137
+ reducedim_initarray (A, region, oneunit (Treduce))
138
138
139
139
for f in (:div , :fld , :fld1 )
140
140
@eval begin
@@ -152,12 +152,12 @@ end
152
152
153
153
# When multiplying by a float, reduce two multiplies to one.
154
154
# Particularly useful for arrays.
155
- scaledual (Tdual:: Type , x) = one (Tdual), x
155
+ scaledual (Tdual:: Type , x) = oneunit (Tdual), x
156
156
scaledual (b:: Tdual , x) where {Tdual <: Number } = b, x
157
157
scaledual (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)
159
159
scaledual (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)
161
161
162
162
@noinline function throw_converterror (:: Type{T} , x) where {T <: FixedPoint }
163
163
n = 2 ^ (8 * sizeof (T))
0 commit comments