Int

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    public var digitsCount: Int { get }
  • SwifterSwift: Random integer between two integer values.

    Declaration

    Swift

    public static func random(between min: Int, and max: Int) -> Int

    Parameters

    min

    minimum number to start random from.

    max

    maximum number random number end before.

    Return Value

    random double between two double values.

  • SwifterSwift: Random integer in a closed interval range.

    Declaration

    Swift

    public static func random(inRange range: ClosedRange<Int>) -> Int

    Parameters

    range

    closed interval range.

    Return Value

    random double in the given closed range.

  • SwifterSwift: check if given integer prime or not. Warning: Using big numbers can be computationally expensive!

    Declaration

    Swift

    public 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

    public func romanNumeral() -> String?

    Return Value

    The roman numeral string.

  • SwifterSwift: Rounds to the closest multiple of n

    Declaration

    Swift

    public func roundToNearest(_ n: Int) -> Int
  • SwifterSwift: Created a random integer between two integer values.

    Declaration

    Swift

    public init(randomBetween min: Int, and max: Int)

    Parameters

    min

    minimum number to start random from.

    max

    maximum number random number end before.

  • SwifterSwift: Create a random integer in a closed interval range.

    Declaration

    Swift

    public init(randomInRange range: ClosedRange<Int>)

    Parameters

    range

    closed interval range.