FloatingPoint

protocol FloatingPoint : SignedNumeric, Strideable, Hashable
  • Returns rounded FloatingPoint to specified number of places

    Declaration

    Swift

    public func rounded(toPlaces places: Int) -> Self
  • Rounds current FloatingPoint to specified number of places

    Declaration

    Swift

    public mutating func round(toPlaces places: Int)
  • Returns ceiled FloatingPoint to specified number of places

    Declaration

    Swift

    public func ceiled(toPlaces places: Int) -> Self
  • Ceils current FloatingPoint to specified number of places

    Declaration

    Swift

    public mutating func ceil(toPlaces places: Int)
  • Returns a random floating point number between 0.0 and 1.0, inclusive.

    Declaration

    Swift

    public static func random() -> Float
  • Returns a random floating point number in the range min…max, inclusive.

    Declaration

    Swift

    public static func random(within: Range<Float>) -> Float