RoundingMode
- iOS
- 8.0+
- macOS
- 10.10+
- tvOS
- 9.0+
- watchOS
- 2.0+
enum RoundingMode
enum RoundingMode
import FoundationEssentials
struct Decimal
case bankers
case down
case plain
case up
init()
init(_ value: Double)
init(_ value: Int)
init(_ value: UInt)
init(_ value: Int8)
init(_ value: Int16)
init(_ value: Int32)
init(_ value: Int64)
init(_ value: UInt8)
init(_ value: UInt16)
init(_ value: UInt32)
init(_ value: UInt64)
init?<T>(exactly source: T) where T : BinaryInteger
init(floatLiteral value: Double)
init(from decoder: any Decoder) throws
init(integerLiteral value: Int)
init(mantissa: UInt64, exponent: Int16, isNegative: Bool)
init(sign: FloatingPointSign, exponent: Int, significand: Decimal)
init(signOf: Decimal, magnitudeOf magnitude: Decimal)
init?(string: String, locale: Locale? = nil)
static let greatestFiniteMagnitude: Decimal
static let leastFiniteMagnitude: Decimal
static let leastNonzeroMagnitude: Decimal
static let leastNormalMagnitude: Decimal
static var nan: Decimal { get }
static let pi: Decimal
static var quietNaN: Decimal { get }
static var radix: Int { get }
static func decimal(from stringView: String.UTF8View, decimalSeparator: String.UTF8View, matchEntireString: Bool) -> (result: Decimal?, processedLength: Int)
var description: String { get }
var exponent: Int { get }
var floatingPointClass: FloatingPointClassification { get }
The IEEE 754 “class” of this type.
var isCanonical: Bool { get }
var isFinite: Bool { get }
true
if self
is zero, subnormal, or normal (not infinity or NaN), false
otherwise.
var isInfinite: Bool { get }
true
if self
is infinity, false
otherwise.
var isNaN: Bool { get }
true
if self
is NaN, false
otherwise.
var isNormal: Bool { get }
true
if self
is normal (not zero, subnormal, infinity, or NaN), false
otherwise.
var isSignMinus: Bool { get }
true
if self
is negative, false
otherwise.
var isSignaling: Bool { get }
true
if self
is a signaling NaN, false
otherwise.
var isSignalingNaN: Bool { get }
true
if self
is a signaling NaN, false
otherwise.
var isSubnormal: Bool { get }
true
if self
is subnormal, false
otherwise.
var isZero: Bool { get }
true
if self
is +0.0 or -0.0, false
otherwise.
var magnitude: Decimal { get }
var nextDown: Decimal { get }
var nextUp: Decimal { get }
var sign: FloatingPointSign { get }
var significand: Decimal { get }
var ulp: Decimal { get }
static func * (lhs: Decimal, rhs: Decimal) -> Decimal
static func *= (lhs: inout Decimal, rhs: Decimal)
static func + (lhs: Decimal, rhs: Decimal) -> Decimal
static func += (lhs: inout Decimal, rhs: Decimal)
static func - (lhs: Decimal, rhs: Decimal) -> Decimal
static func -= (lhs: inout Decimal, rhs: Decimal)
static func / (lhs: Decimal, rhs: Decimal) -> Decimal
static func /= (lhs: inout Decimal, rhs: Decimal)
static func < (lhs: Decimal, rhs: Decimal) -> Bool
static func == (lhs: Decimal, rhs: Decimal) -> Bool
func advanced(by n: Decimal) -> Decimal
func distance(to other: Decimal) -> Decimal
func encode(to encoder: any Encoder) throws
func hash(into hasher: inout Hasher)
func isEqual(to other: Decimal) -> Bool
func isLess(than other: Decimal) -> Bool
func isLessThanOrEqualTo(_ other: Decimal) -> Bool
func isTotallyOrdered(belowOrEqualTo other: Decimal) -> Bool
mutating func negate()
func toString(with locale: Locale? = nil) -> String
enum CalculationError
typealias Mantissa = (UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16)
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init?(rawValue: UInt)
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)