Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use iszero in isinteger(::AbstractFloat) (JuliaLang#55276)
This is a very slight tweak to the implementation of `isinteger(::AbstractFloat)` to use `iszero` rather than `== 0`. It shouldn't make any difference with any of the built-in floating-point types, but `iszero` might conceivably be faster for some user-defined types. I also added a comment to indicate why it's using `iszero(x - trunc(x))` rather than `x == trunc(x)` (due to non-finite values); this code dates back to JuliaLang#14569 in Julia 0.5. --------- Co-authored-by: Sukera <[email protected]>
- Loading branch information