Skip to content

Commit 71eb75e

Browse files
committed
Don't use Float32 in printing
1 parent a00d54c commit 71eb75e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/FixedPointNumbers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function show{T,f}(io::IO, x::FixedPoint{T,f})
155155
print(io, ")")
156156
end
157157
const _log2_10 = 3.321928094887362
158-
showcompact{T,f}(io::IO, x::FixedPoint{T,f}) = show(io, round(float(x), ceil(Int,f/_log2_10)))
158+
showcompact{T,f}(io::IO, x::FixedPoint{T,f}) = show(io, round(Float64(x), ceil(Int,f/_log2_10)))
159159

160160
@noinline function throw_converterror{T<:FixedPoint}(::Type{T}, x)
161161
n = 2^(8*sizeof(T))

test/ufixed.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ x = 0xaauf8
234234
iob = IOBuffer()
235235
show(iob, x)
236236
str = takebuf_string(iob)
237-
@test startswith(str, "UFixed{UInt8,8}(")
238-
@test eval(parse(str)) == x
237+
@test str == "UFixed{UInt8,8}(0.667)"
239238

240239
# scaledual
241240
function generic_scale!(C::AbstractArray, X::AbstractArray, s::Number)

0 commit comments

Comments
 (0)