1
1
# Swift NumberKit
2
2
3
- [ ![ Platforms: macOS, iOS, Linux] ( https://img.shields.io/badge/Platforms-macOS,%20iOS,%20Linux-blue.svg?style=flat )] ( https://developer.apple.com/osx/ ) [ ![ Language: Swift 5.7 ] ( https://img.shields.io/badge/Language-Swift%205.7 -green.svg?style=flat )] ( https://developer.apple.com/swift/ ) [ ![ IDE: Xcode 14 ] ( https://img.shields.io/badge/IDE-Xcode%2014 -orange.svg?style=flat )] ( https://developer.apple.com/xcode/ ) [ ![ Package managers: SwiftPM, Carthage] ( https://img.shields.io/badge/Package%20managers-SwiftPM,%20Carthage-8E64B0.svg?style=flat )] ( https://github.com/Carthage/Carthage ) [ ![ License: Apache] ( http://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat )] ( https://raw.githubusercontent.com/objecthub/swift-numberkit/master/LICENSE )
3
+ [ ![ Platforms: macOS, iOS, Linux] ( https://img.shields.io/badge/Platforms-macOS,%20iOS,%20Linux-blue.svg?style=flat )] ( https://developer.apple.com/osx/ ) [ ![ Language: Swift 5.9 ] ( https://img.shields.io/badge/Language-Swift%205.9 -green.svg?style=flat )] ( https://developer.apple.com/swift/ ) [ ![ IDE: Xcode 15 ] ( https://img.shields.io/badge/IDE-Xcode%2015 -orange.svg?style=flat )] ( https://developer.apple.com/xcode/ ) [ ![ Package managers: SwiftPM, Carthage] ( https://img.shields.io/badge/Package%20managers-SwiftPM,%20Carthage-8E64B0.svg?style=flat )] ( https://github.com/Carthage/Carthage ) [ ![ License: Apache] ( http://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat )] ( https://raw.githubusercontent.com/objecthub/swift-numberkit/master/LICENSE )
4
4
5
5
## Overview
6
6
7
7
This is a framework implementing advanced numeric data types for the Swift programming
8
- language on macOS, iOS and Linux. Currently, the framework provides three new numeric types,
9
- each represented as a struct:
8
+ language on macOS, iOS and Linux. Currently, the framework provides four new numeric types,
9
+ each represented as a struct or enumeration :
10
10
11
- 1 . ` BigInt ` : arbitrary-precision signed integers
11
+ 1 . ` BigInt ` : arbitrary-size signed integers
12
+ 2 . ` Integer ` : arbitrary-size signed integers whose implementation depends on the size
13
+ of the represented value.
12
14
2 . ` Rational ` : signed rational numbers
13
15
3 . ` Complex ` : complex floating-point numbers
14
16
@@ -21,12 +23,20 @@ real, generic enough foundation (and still isn't).
21
23
22
24
## BigInt
23
25
24
- ` BigInt ` objects are immutable, signed, arbitrary-precision integers that can be used as a
26
+ ` BigInt ` values are immutable, signed, arbitrary-size integers that can be used as a
25
27
drop-in replacement for the existing binary integer types of Swift 5.
26
28
[ Struct ` BigInt ` ] ( https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/BigInt.swift ) defines all
27
- the standard arithmetic integer operations and implements the corresponding protocols defined
28
- in the standard library .
29
+ the standard arithmetic integer operations and implements the corresponding protocols provided
30
+ by Swift .
29
31
32
+ ## Integer
33
+
34
+ ` Integer ` values are immutable, signed, arbitrary-size integers that can be used as a
35
+ drop-in replacement for the existing binary integer types of Swift 5. As opposed to ` BigInt ` ,
36
+ the representation of values is chosen to optimize for memory size and performance of
37
+ airthmetic operations. [ Enum ` Integer ` ] ( https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Integer.swift )
38
+ defines all the standard arithmetic integer operations and implements the corresponding protocols
39
+ provided by the Swift standard library.
30
40
31
41
## Rational
32
42
@@ -35,7 +45,6 @@ defines immutable, rational numbers based on an existing signed integer
35
45
type ` T ` , like ` Int32 ` , ` Int64 ` , or ` BigInt ` . A rational number is a signed number that can
36
46
be expressed as the quotient of two integers _ a_ and _ b_ : _ a / b_ .
37
47
38
-
39
48
## Complex
40
49
41
50
[ Struct ` Complex<T> ` ] ( https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Complex.swift )
@@ -47,12 +56,12 @@ where _i_ is the _imaginary unit_.
47
56
48
57
The following technologies are needed to build the components of the _ Swift NumberKit_ framework:
49
58
50
- - [ Xcode 14 ] ( https://developer.apple.com/xcode/ )
51
- - [ Swift 5.8 ] ( https://developer.apple.com/swift/ )
59
+ - [ Xcode 15 ] ( https://developer.apple.com/xcode/ )
60
+ - [ Swift 5.9 ] ( https://developer.apple.com/swift/ )
52
61
- [ Swift Package Manager] ( https://swift.org/package-manager/ )
53
62
- macOS, iOS or Linux
54
63
55
64
## Copyright
56
65
57
66
Author: Matthias Zenger (
< [email protected] > )
58
- Copyright © 2016-2023 Matthias Zenger. All rights reserved.
67
+ Copyright © 2016-2024 Matthias Zenger. All rights reserved.
0 commit comments