Skip to content

TeamAllegro/swift-numberkit

 
 

Repository files navigation

Swift NumberKit

Platform: OS X Language: Swift 3 License: Apache

Overview

This is a library providing advanced numeric data types for the Swift 3 programming language. The current version implements three new numeric types:

  1. BigInt: arbitrary-precision signed integers
  2. Rational: signed rational numbers
  3. Complex: complex floating-point numbers

Requirements: Xcode 8.0, Swift 3.0

BigInt

BigInt objects are immutable, signed, arbitrary-precision integers that can be used as a drop-in replacement for the existing integer types of Swift 3. Struct BigInt defines all the standard arithmetic integer operations and implements the corresponding protocols defined in the standard library.

Rational

Struct Rational<T> defines immutable, rational numbers based on an existing signed integer type T, like Int32, Int64, or BigInt. A rational number is a signed number that can be expressed as the quotient of two integers a and b: a / b.

Complex

Struct Complex<T> defines complex numbers based on an existing floating point type T, like Float or Double. A complex number consists of two components, a real part re and an imaginary part im and is typically written as: re + im * i where i is the imaginary unit.

About

Advanced numeric data types for Swift 3, including BigInt, Rational, and Complex numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 98.6%
  • Objective-C 1.4%