A rule for rounding a floating-point number.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
enum FloatingPointRoundingRule
A rule for rounding a floating-point number.
SDK
Framework
enum FloatingPointRoundingRule
case away From ZeroRound to the closest allowed value whose magnitude is greater than or equal to that of the source.
case downRound to the closest allowed value that is less than or equal to the source.
case to Nearest Or Away From ZeroRound to the closest allowed value; if two values are equally close, the one with greater magnitude is chosen.
case to Nearest Or EvenRound to the closest allowed value; if two values are equally close, the even one is chosen.
case toward ZeroRound to the closest allowed value whose magnitude is less than or equal to that of the source.
case upRound to the closest allowed value that is greater than or equal to the source.
var hash Value: IntThe hash value.
func hash(into: inout Hasher)Hashes the essential components of this value by feeding them into the given hasher.
static func != (Floating Point Rounding Rule, Floating Point Rounding Rule) -> BoolReturns a Boolean value indicating whether two values are not equal.
static func == (Floating Point Rounding Rule, Floating Point Rounding Rule) -> BoolReturns a Boolean value indicating whether two values are equal.