Integer
protocol Integer : _Integer, Strideable
-
Receiver integer is 0.
Declaration
Swift
var isZero: Bool
-
Receiver integer is greater than 0.
Declaration
Swift
var isPositive: Bool
-
Receiver integer is less than 0.
Declaration
Swift
var isNegative: Bool
-
Receiver integer is dividing evenly.
Declaration
Swift
var isEven: Bool
-
Receiver integer is not dividing evenly.
Declaration
Swift
var isOdd: Bool
-
Returns the absolute value of
self
.(-1).abs #=> 1 (-2).abs #=> 2 (2).abs #=> 2 (0).abs #=> 0
Declaration
Swift
var abs: Self
-
An alias to
Integer#abs
, returns the absolute value ofself
.(-1).magnitude #=> 1 (-2).magnitude #=> 2 (2).magnitude #=> 2 (0).magnitude #=> 0
See
See Also:Integer#abs
Declaration
Swift
var magnitude: Self
-
Undocumented
Declaration
Swift
protocol Integer : _Integer, Strideable