Skip to content

Commit c308af2

Browse files
committed
Update realmin, realmax references to floatmin, floatmax
1 parent 253e075 commit c308af2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/FixedPointDecimals.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ export FixedDecimal, RoundThrows
2929

3030
using Compat: lastindex, something
3131

32+
import Compat: floatmin, floatmax
33+
3234
import Base: reinterpret, zero, one, abs, sign, ==, <, <=, +, -, /, *, div, rem, divrem,
3335
fld, mod, fldmod, fld1, mod1, fldmod1, isinteger, typemin, typemax,
34-
realmin, realmax, print, show, string, convert, parse, promote_rule, min, max,
36+
print, show, string, convert, parse, promote_rule, min, max,
3537
trunc, round, floor, ceil, eps, float, widemul, decompose
3638

3739
const BitInteger = Union{Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64,
@@ -339,8 +341,8 @@ typemin(::Type{FD{T, f}}) where {T, f} = reinterpret(FD{T, f}, typemin(T))
339341
typemax(::Type{FD{T, f}}) where {T, f}= reinterpret(FD{T, f}, typemax(T))
340342
eps(::Type{T}) where {T <: FD} = reinterpret(T, 1)
341343
eps(x::FD) = eps(typeof(x))
342-
realmin(::Type{T}) where {T <: FD} = eps(T)
343-
realmax(::Type{T}) where {T <: FD} = typemax(T)
344+
floatmin(::Type{T}) where {T <: FD} = eps(T)
345+
floatmax(::Type{T}) where {T <: FD} = typemax(T)
344346

345347
# printing
346348
function print(io::IO, x::FD{T, 0}) where T

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ end
288288
@test FD2(42.42) * FD2(1) == FD2(42.42)
289289
end
290290

291-
@testset "eps, realmin, realmax" begin
292-
@test realmin(FD2) == eps(FD2) == FD2(0.01)
291+
@testset "eps, floatmin, floatmax" begin
292+
@test floatmin(FD2) == eps(FD2) == FD2(0.01)
293293
@test eps(FD2(1.11)) == FD2(0.01)
294294
for x in keyvalues[FD2]
295295
if x typemax(FD2)
@@ -298,7 +298,7 @@ end
298298
if x typemin(FD2)
299299
@test x - eps(x) < x
300300
if x 0
301-
@test realmin(FD2) abs(x) realmax(FD2)
301+
@test floatmin(FD2) abs(x) floatmax(FD2)
302302
end
303303
end
304304
end

0 commit comments

Comments
 (0)