Skip to content

Commit a19f1c7

Browse files
added project requirements to README
1 parent ec1c168 commit a19f1c7

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// swift-tools-version: 5.8
1+
// swift-tools-version:5.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "huge-numbers",
88
platforms: [
9+
.macOS(.v10_15),
910
.iOS(.v13),
10-
.macOS(.v10_15)
11+
.tvOS(.v13),
12+
.watchOS(.v6)
1113
],
1214
products: [
1315
// Products define the executables and libraries a package produces, and make them visible to other packages.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This library was created to remove the decimal precision limitation on floats, which is especially useful in scientific applications.
44

5+
## Requirements
6+
- Swift >= 5.1
7+
- macOS >= 10.15
8+
- iOS >= 13.0
9+
- tvOS >= 13.0
10+
- watchOS >= 6.0
11+
512
## Current features
613
- `HugeInt`
714
- `HugeFloat`

Tests/huge-numbersTests/huge_numbersTests.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ extension huge_numbersTests {
129129
}
130130

131131
extension huge_numbersTests {
132-
@available(macOS 13.0, iOS 16.0, *)
132+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, *)
133133
private func benchmark(iteration_count: Int = 10_00, key: String, _ code: @escaping () async throws -> Void, will_print: Bool = true) async throws -> (key: String, min: Int64, max: Int64, median: Int64, average: Int64, total: Int64) {
134134
let clock:SuspendingClock = SuspendingClock()
135135
let _:Duration = try await clock.measure(code)
@@ -162,8 +162,11 @@ extension huge_numbersTests {
162162
}
163163
return (key: key, min: minimum, max: maximum, median: median, average: average, total: sum)
164164
}
165-
@available(macOS 13.0, iOS 16.0, *)
166165
private func benchmark_compare_is_faster(maximum_iterations: Int = 100, key1: String, _ code1: @escaping () async throws -> Void, key2: String, code2: @escaping () async throws -> Void) async throws {
166+
guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, *) else {
167+
print("huge_numbersTests;benchmark_compare_is_faster; unsupported platform version")
168+
return
169+
}
167170
var faster_count:Int = 0, faster_average:Int64 = 0
168171
for _ in 1...maximum_iterations {
169172
let faster:(Bool, Int64) = try await benchmark_compare(key1: key1, code1, key2: key2, code2: code2, print_to_console: false)
@@ -176,7 +179,7 @@ extension huge_numbersTests {
176179
let average_string:String = get_benchmark_formatted_string(formatter: formatter, faster_average / Int64(maximum_iterations))
177180
print("huge_numbersTests;benchmark_compare_is_faster; " + key1 + " is faster \(faster_count)/\(maximum_iterations) on average by " + average_string)
178181
}
179-
@available(macOS 13.0, iOS 16.0, *)
182+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, *)
180183
private func benchmark_compare(key1: String, _ code1: @escaping () async throws -> Void, key2: String, code2: @escaping () async throws -> Void, print_to_console: Bool = true) async throws -> (Bool, Int64) {
181184
async let test1 = benchmark(key: key1, code1, will_print: false)
182185
async let test2 = benchmark(key: key2, code2, will_print: false)
@@ -993,7 +996,7 @@ extension huge_numbersTests {
993996
print("test_pi;pi=" + pi.description + ";precision=" + precision.description)*/
994997
}
995998
private func test_pi_indexes(i: Int, _ pi_digits: String, bigger_digits: String) {
996-
if #available(macOS 13.0, iOS 16.0, *) {
999+
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, *) {
9971000
let ranges:[Range<String.Index>] = pi_digits.ranges(of: String(describing: i))
9981001
var range_index:Int = 0
9991002
for range in ranges {
@@ -1005,7 +1008,7 @@ extension huge_numbersTests {
10051008
}
10061009
}
10071010
private func test_pi_ranges(i: Int, _ pi_digits: String) {
1008-
if #available(macOS 13.0, iOS 16.0, *) {
1011+
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, *) {
10091012
let string_count:Int = pi_digits.count
10101013
let ranges:[Range<String.Index>] = pi_digits.ranges(of: String(describing: i))
10111014
var minimum_distance_between:Int = string_count, maximum_distance_between:Int = 0

0 commit comments

Comments
 (0)