Latest 1.0.2
Homepage https://github.com/wltrup/Swift-WTBinaryFloatingPointExtensions
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

What

WTBinaryFloatingPointExtensions adds to all floating point types conforming to the
BinaryFloatingPoint protocol some commonly used trigonometry-related computed properties,
conversions between degrees and radians, and functions to generate uniformly distributed
(pseudo) random values. Here’s the full set of API additions:

public enum WTBinaryFloatingPointExtensionsError : Error
{
    case allArgumentsAreZero
}

public static var piOver4: Self { get }
public static var piOver2: Self { get }
public static var threePiOver2: Self { get }
public static var twoPi: Self { get }

public var radiansInDegrees: Self { get }
public var degreesInRadians: Self { get }

public static var random01: Self { get }

public static func random(_ a: Self, _ b: Self) -> Self
public static func randomNonZero(_ a: Self, _ b: Self) throws -> Self

Why

Because I find myself using those quite often and they are missing from the default implementations
of the floating point types.

Tests

WTBinaryFloatingPointExtensions adds 9 extensions, all fully tested by 14 tests with 100% coverage.

Changelog

Changes to WTBinaryFloatingPointExtensions are listed
here.

Installation

WTBinaryFloatingPointExtensions is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "WTBinaryFloatingPointExtensions"

Author

Wagner Truppel, [email protected]

License

WTBinaryFloatingPointExtensions is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "WTBinaryFloatingPointExtensions",
    "version": "1.0.2",
    "summary": "WTBinaryFloatingPointExtensions adds a number of useful extensions to all floating types.",
    "description": "WTBinaryFloatingPointExtensions adds a number of useful extensions to all floating types,nsuch as conversions between degrees and radians and uniform pseudo-random distributions.",
    "homepage": "https://github.com/wltrup/Swift-WTBinaryFloatingPointExtensions",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Wagner Truppel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wltrup/Swift-WTBinaryFloatingPointExtensions.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "WTBinaryFloatingPointExtensions/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This