Int

@frozen
struct Int : FixedWidthInteger, SignedInteger
  • SwifterSwift: CountableRange 0..<Int.

    Declaration

    Swift

    var countableRange: CountableRange<Int> { get }
  • SwifterSwift: Radian value of degree input.

    Declaration

    Swift

    var degreesToRadians: Double { get }
  • SwifterSwift: Degree value of radian input

    Declaration

    Swift

    var radiansToDegrees: Double { get }
  • SwifterSwift: UInt.

    Declaration

    Swift

    var uInt: UInt { get }
  • SwifterSwift: Double.

    Declaration

    Swift

    var double: Double { get }
  • SwifterSwift: Float.

    Declaration

    Swift

    var float: Float { get }
  • SwifterSwift: CGFloat.

    Declaration

    Swift

    var cgFloat: CGFloat { get }
  • SwifterSwift: String formatted for values over ±1000 (example: 1k, -2k, 100k, 1kk, -5kk..)

    Declaration

    Swift

    var kFormatted: String { get }
  • SwifterSwift: Array of digits of integer value.

    Declaration

    Swift

    var digits: [Int] { get }
  • SwifterSwift: Number of digits of integer value.

    Declaration

    Swift

    var digitsCount: Int { get }
  • SwifterSwift: check if given integer prime or not. Warning: Using big numbers can be computationally expensive!

    Declaration

    Swift

    func isPrime() -> Bool

    Return Value

    true or false depending on prime-ness

  • SwifterSwift: Roman numeral string from integer (if applicable).

    10.romanNumeral() -> X

    Declaration

    Swift

    func romanNumeral() -> String?

    Return Value

    The roman numeral string.

  • SwifterSwift: Rounds to the closest multiple of n

    Declaration

    Swift

    func roundToNearest(_ number: Int) -> Int