isInfinite
TypeScriptget isInfinite(): booleanSwift declarationvar isInfinite: Bool { get }A Boolean value indicating whether this decimal is infinity.
struct · SDK 27.1
struct Decimalget isInfinite(): booleanSwift declarationvar isInfinite: Bool { get }A Boolean value indicating whether this decimal is infinity.
get description(): stringSwift declarationvar description: String { get }A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.
get isCanonical(): booleanSwift declarationvar isCanonical: Bool { get }A Boolean value indicating whether the representation of this decimal is canonical.
get isSignMinus(): booleanSwift declarationvar isSignMinus: Bool { get }A Boolean value indicating whether this decimal has a negative sign. This property is `true` when the value is negative or `-0.0`; otherwise, `false`.
get isSignaling(): booleanSwift declarationvar isSignaling: Bool { get }A Boolean value indicating whether this decimal is a signaling NaN.
get isSubnormal(): booleanSwift declarationvar isSubnormal: Bool { get }A Boolean value indicating whether this decimal is subnormal.
get significand(): DecimalSwift declarationvar significand: Decimal { get }The significand of the decimal.
static initFloatLiteral(value: number): DecimalSwift declarationinit(floatLiteral value: Double)Creates and initializes a decimal with the provided floating point value.
static initIntegerLiteral(value: number): DecimalSwift declarationinit(integerLiteral value: Int)Creates and initializes a decimal with the provided integer value.
get isSignalingNaN(): booleanSwift declarationvar isSignalingNaN: Bool { get }A Boolean value indicating whether this decimal is a signaling NaN.
isTotallyOrdered(other: Decimal): booleanSwift declarationfunc isTotallyOrdered(belowOrEqualTo other: Decimal) -> BoolReturns a Boolean value indicating whether this instance should precede the given value in an ascending sort.
get floatingPointClass(): SDKHandleSwift declarationvar floatingPointClass: FloatingPointClassification { get }The IEEE 754 class of this type.
isLessThanOrEqualTo(other: Decimal): booleanSwift declarationfunc isLessThanOrEqualTo(_ other: Decimal) -> BoolIndicates whether this decimal is less than or equal to the specified one.
static get leastFiniteMagnitude(): DecimalSwift declarationstatic let leastFiniteMagnitude: DecimalThe decimal that contains the smallest possible non-infinite magnitude for the underlying representation.
static get leastNormalMagnitude(): DecimalSwift declarationstatic let leastNormalMagnitude: DecimalThe decimal value that represents the smallest possible normal magnitude for the underlying representation.
static get leastNonzeroMagnitude(): DecimalSwift declarationstatic let leastNonzeroMagnitude: DecimalThe decimal value that represents the smallest possible non-zero value for the underlying representation.
static get greatestFiniteMagnitude(): DecimalSwift declarationstatic let greatestFiniteMagnitude: DecimalThe decimal that contains the largest possible non-infinite magnitude for the underlying representation.
static get pi(): DecimalSwift declarationstatic let pi: DecimalThe mathematical constant pi.
static get nan(): DecimalSwift declarationstatic var nan: Decimal { get }The value that represents "not a number."
get ulp(): DecimalSwift declarationvar ulp: Decimal { get }The unit in the last place of the decimal.
static initSignExponentSignificand(sign: SDKHandle, exponent: number, significand: Decimal): DecimalSwift declarationinit(sign: FloatingPointSign, exponent: Int, significand: Decimal)Creates a decimal initialized with the given sign, exponent, and significand.
get sign(): SDKHandleSwift declarationvar sign: FloatingPointSign { get }The sign of the decimal.
get isNaN(): booleanSwift declarationvar isNaN: Bool { get }A Boolean value indicating whether this decimal is NaN.
static get radix(): numberSwift declarationstatic var radix: Int { get }The radix used by decimal numbers.
isLess(other: Decimal): booleanSwift declarationfunc isLess(than other: Decimal) -> BoolIndicates whether this decimal is less than the specified one.
get isZero(): booleanSwift declarationvar isZero: Bool { get }A Boolean value indicating whether this value is zero. This property is `true` for `-0.0` and `+0.0` and `false` for all other values.
negate(): voidSwift declarationmutating func negate()Negates this decimal.
get nextUp(): DecimalSwift declarationvar nextUp: Decimal { get }The least representable value that is greater than this decimal.
static initSignOfMagnitudeOf(signOf: Decimal, magnitude: Decimal): DecimalSwift declarationinit(signOf: Decimal, magnitudeOf magnitude: Decimal)Creates and initializes a decimal with the sign and magnitude of the given decimals. - Parameters: - signOf: A `Decimal` to use for the sign of the newly-created `Decimal`. - magnitude: A `Decimal` to use for the magnitude of the newly-created `Decimal`.
static initStringLocale(string: string, locale?: (Locale) | null): (Decimal) | nullSwift declarationinit?(string: String, locale: Locale? = nil)Creates and initializes a decimal by parsing a string according to the provided locale's conventions. - Parameters: - string: A string containing a formatted decimal value. - locale: A locale that indicates the formatting conventions used by `string`.
static initExactly(source: number): (Decimal) | nullSwift declarationinit?<T>(exactly source: T) where T : BinaryIntegerCreates a new decimal value exactly representing the provided integer. If `source` isn't representable as a `Decimal` instance, the result is `nil`. - Parameter source: The integer to convert.
isEqual(other: Decimal): booleanSwift declarationfunc isEqual(to other: Decimal) -> BoolIndicates whether this decimal is equal to the specified one.
advanced(n: Decimal): DecimalSwift declarationfunc advanced(by n: Decimal) -> DecimalReturns a new value advanced by the given distance.
distance(other: Decimal): DecimalSwift declarationfunc distance(to other: Decimal) -> DecimalReturns the distance from this value to the specified value.
get exponent(): numberSwift declarationvar exponent: Int { get }The exponent of the decimal.
get isFinite(): booleanSwift declarationvar isFinite: Bool { get }A Boolean value indicating whether this decimal is zero, subnormal, or normal (not infinity or NaN).
get isNormal(): booleanSwift declarationvar isNormal: Bool { get }A Boolean value indicating whether this decimal is normal (not zero, subnormal, infinity, or NaN).
get nextDown(): DecimalSwift declarationvar nextDown: Decimal { get }The greatest representable value that is less than this decimal.
static get quietNaN(): DecimalSwift declarationstatic var quietNaN: Decimal { get }A quiet representation of not-a-number.
formatted(): stringSwift declarationfunc formatted() -> StringFormats the decimal using a default localized format style. - Returns: A string representation of the decimal, formatted according to the default format style.
get magnitude(): DecimalSwift declarationvar magnitude: Decimal { get }The magnitude of this decimal.
static initFormatLenient(value: string, format: Decimal_FormatStyle_Percent, lenient?: boolean): DecimalSwift declarationinit(_ value: String, format: Decimal.FormatStyle.Percent, lenient: Bool = true) throwsstatic initFormatLenient97749(value: string, format: Decimal_FormatStyle_Currency, lenient?: boolean): DecimalSwift declarationinit(_ value: String, format: Decimal.FormatStyle.Currency, lenient: Bool = true) throwsstatic initFormatLenient99272(value: string, format: Decimal_FormatStyle, lenient?: boolean): DecimalSwift declarationinit(_ value: String, format: Decimal.FormatStyle, lenient: Bool = true) throwsstatic init(value: number): DecimalSwift declarationinit(_ value: Double)Creates and initializes a decimal with the provided floating point value.
static init66917(value: number): DecimalSwift declarationinit(_ value: Int)Creates and initializes a decimal with the provided integer value.
static init10465(value: number): DecimalSwift declarationinit(_ value: UInt)Creates and initializes a decimal with the provided unsigned integer value.
static init67929(value: number): DecimalSwift declarationinit(_ value: Int8)Creates and initializes a decimal with the provided integer value.
static init4129(value: number): DecimalSwift declarationinit(_ value: Int16)Creates and initializes a decimal with the provided integer value.
static init76231(value: number): DecimalSwift declarationinit(_ value: Int32)Creates and initializes a decimal with the provided integer value.
static init66852(value: number): DecimalSwift declarationinit(_ value: Int64)Creates and initializes a decimal with the provided integer value.
static init41211(value: number): DecimalSwift declarationinit(_ value: UInt8)Creates and initializes a decimal with the provided unsigned integer value.
static init80811(value: number): DecimalSwift declarationinit(_ value: UInt16)Creates and initializes a decimal with the provided unsigned integer value.
static init74909(value: number): DecimalSwift declarationinit(_ value: UInt32)Creates and initializes a decimal with the provided unsigned integer value.
static init26262(value: number): DecimalSwift declarationinit(_ value: UInt64)Creates and initializes a decimal with the provided unsigned integer value.
static init47032(): DecimalSwift declarationinit()2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
Decimal.formatted(_:)
This declaration needs Swift generic type arguments. (no canonical witness for S)
Decimal.init(_:strategy:)
This declaration needs Swift generic type arguments. (no canonical witness for S.ParseInput)