File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,7 @@ julia> bits(Int8(12))
480
480
See also [`>>`](@ref), [`>>>`](@ref).
481
481
"""
482
482
function << (x:: Integer , c:: Integer )
483
+ @_inline_meta
483
484
typemin (Int) <= c <= typemax (Int) && return x << (c % Int)
484
485
(x >= 0 || c >= 0 ) && return zero (x)
485
486
oftype (x, - 1 )
@@ -518,6 +519,7 @@ julia> bits(Int8(-4))
518
519
See also [`>>>`](@ref), [`<<`](@ref).
519
520
"""
520
521
function >> (x:: Integer , c:: Integer )
522
+ @_inline_meta
521
523
typemin (Int) <= c <= typemax (Int) && return x >> (c % Int)
522
524
(x >= 0 || c < 0 ) && return zero (x)
523
525
oftype (x, - 1 )
@@ -551,8 +553,10 @@ is equivalent to [`>>`](@ref).
551
553
552
554
See also [`>>`](@ref), [`<<`](@ref).
553
555
"""
554
- >>> (x:: Integer , c:: Integer ) =
556
+ function >>> (x:: Integer , c:: Integer )
557
+ @_inline_meta
555
558
typemin (Int) <= c <= typemax (Int) ? x >>> (c % Int) : zero (x)
559
+ end
556
560
>>> (x:: Integer , c:: Unsigned ) = c <= typemax (UInt) ? x >>> (c % UInt) : zero (x)
557
561
>>> (x:: Integer , c:: Int ) = c >= 0 ? x >>> unsigned (c) : x << unsigned (- c)
558
562
You can’t perform that action at this time.
0 commit comments