Skip to content

Commit ee5bd54

Browse files
committed
Fix rem problem with negative float inputs on ARMv7
1 parent 70ae1d6 commit ee5bd54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/normed.jl

+6
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,9 @@ end
203203

204204
_unsafe_trunc(::Type{T}, x::Integer) where {T} = x % T
205205
_unsafe_trunc(::Type{T}, x) where {T} = unsafe_trunc(T, x)
206+
if !signbit(signed(unsafe_trunc(UInt, -12.345)))
207+
# a workaround for 32-bit ARMv7 (issue #134)
208+
function _unsafe_trunc(::Type{T}, x::AbstractFloat) where {T}
209+
unsafe_trunc(T, unsafe_trunc(typeof(signed(zero(T))), x))
210+
end
211+
end

0 commit comments

Comments
 (0)