Skip to content

Commit bb32fc7

Browse files
Merge pull request #17 from SomeRandomiOSDev/negation-issue
Fixed negation issue
2 parents 28838ea + 4066aa2 commit bb32fc7

24 files changed

+48
-46
lines changed

.swiftlint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ disabled_rules:
66
- type_name
77

88
opt_in_rules:
9-
- anyobject_protocol
109
- array_init
1110
- closure_end_indentation
1211
- closure_spacing
@@ -21,7 +20,6 @@ opt_in_rules:
2120
- first_where
2221
- force_unwrapping
2322
- function_default_parameter_at_end
24-
- inert_defer
2523
- no_extension_access_modifier
2624
- overridden_super_call
2725
- prohibited_super_call

Half.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "Half"
4-
s.version = "1.4.0"
4+
s.version = "1.4.1"
55
s.summary = "Swift Half-Precision Floating Point"
66
s.description = <<-DESC
77
A lightweight framework containing a Swift implementation for a half-precision floating point type for iOS, macOS, tvOS, and watchOS.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Joe Newton <somerandomiosdev@gmail.com>
1+
Copyright (c) 2023 Joe Newton <somerandomiosdev@gmail.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Sources/CHalf/include/half.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// half.h
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
#ifndef half_h

Sources/CHalf/src/half.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// half.c
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
#include "half.h"
@@ -63,7 +63,7 @@ HALF_FUNC half_t _half_mul(const half_t lhs, const half_t rhs) { return HALF_FRO
6363
HALF_FUNC half_t _half_div(const half_t lhs, const half_t rhs) { return HALF_FROM_FP16(FP16_FROM_HALF(lhs) / FP16_FROM_HALF(rhs)); }
6464
HALF_FUNC half_t _half_fma(const half_t val, const half_t lhs, const half_t rhs) { return HALF_FROM_FP16(FP16_FROM_HALF(val) + (FP16_FROM_HALF(lhs) * FP16_FROM_HALF(rhs))); }
6565

66-
HALF_FUNC half_t _half_neg(const half_t val) { return HALF_FROM_FP16(0.0 - FP16_FROM_HALF(val)); }
66+
HALF_FUNC half_t _half_neg(const half_t val) { return HALF_FROM_RAW(RAW_FROM_HALF(val) ^ 0x8000); } // flip the sign bit
6767
HALF_FUNC half_t _half_abs(const half_t val) { return HALF_FROM_RAW(RAW_FROM_HALF(val) & 0x7FFF); } // clear sign bit
6868
HALF_FUNC half_t _half_sqrt(const half_t val) { return _half_from(sqrt((float)FP16_FROM_HALF(val))); }
6969

Sources/Half/Functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Functions.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
#if os(Linux)

Sources/Half/Half+Coding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Half+Coding.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
// MARK: - Codable Protocol Conformance

Sources/Half/Half.docc/Floating-Point-Operators-for-Half.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ Perform arithmetic and bitwise operations or compare values.
66

77
### Arithmetic
88

9-
- ``Half/Half/+(_:_:)``
10-
- ``Half/Half/-(_:_:)``
11-
- ``Half/Half/*(_:_:)``
12-
- ``Half/Half//(_:_:)``
9+
- ``Half-swift.struct/+(_:_:)``
10+
- ``Half-swift.struct/-(_:_:)``
11+
- ``Half-swift.struct/*(_:_:)``
12+
- <doc://com.somerandomiosdev.half/documentation/Half/Half//(_:_:)>
1313

1414
### Arithmetic with Assignment
1515

16-
- ``Half/Half/+=(_:_:)-75r0k``
17-
- ``Half/Half/-=(_:_:)-9q37z``
18-
- ``Half/Half/*=(_:_:)``
19-
- ``Half/Half//=(_:_:)``
16+
- ``Half-swift.struct/+=(_:_:)-75r0k``
17+
- ``Half-swift.struct/-=(_:_:)``
18+
- ``Half-swift.struct/*=(_:_:)``
19+
- <doc://com.somerandomiosdev.half/documentation/Half/Half//=(_:_:)>
2020

2121
### Comparison
2222

23-
- ``Half/Half/==(_:_:)-5s308``
24-
- ``Half/Half/!=(_:_:)``
25-
- ``Half/Half/_(_:_:)-6mxe4``
26-
- ``Half/Half/_=(_:_:)-8rfdq``
27-
- ``Half/Half/_(_:_:)-6lwhi``
28-
- ``Half/Half/_=(_:_:)-6vpuz``
23+
- ``Half-swift.struct/==(_:_:)-5s308``
24+
- ``Half-swift.struct/!=(_:_:)``
25+
- ``Half-swift.struct/<(_:_:)-6mxe4``
26+
- ``Half-swift.struct/<=(_:_:)-8rfdq``
27+
- ``Half-swift.struct/>(_:_:)-6lwhi``
28+
- ``Half-swift.struct/>=(_:_:)-6vpuz``
2929

3030
### Negation
3131

32-
- ``Half/Half/-(_:)-7binx``
33-
- ``Half/Half/+(_:)``
32+
- ``Half-swift.struct/-(_:)``
33+
- ``Half-swift.struct/+(_:)``
3434

3535
### Range Expressions
3636

37-
- ``Half/Half/.._(_:)``
38-
- ``Half/Half/...(_:)-1tjn1``
39-
- ``Half/Half/...(_:)-4kfvw``
37+
- ``Half-swift.struct/..<(_:)``
38+
- ``Half-swift.struct/...(_:)-1tjn1``
39+
- ``Half-swift.struct/...(_:)-4kfvw``
4040

41-
<!-- Copyright (c) 2022 SomeRandomiOSDev. All Rights Reserved. -->
41+
<!-- Copyright (c) 2023 SomeRandomiOSDev. All Rights Reserved. -->

Sources/Half/Half.docc/Half-swift.struct.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ These initializers result in `nil` if the value passed can't be represented with
127127

128128
### Creating a Range
129129

130-
- ``.._(_:_:)``
130+
- ``..<(_:_:)``
131131
- ``...(_:_:)``
132132

133133
### Describing a Half
@@ -147,4 +147,4 @@ These initializers result in `nil` if the value passed can't be represented with
147147
- ``write(to:)``
148148
- ``hashValue``
149149

150-
<!-- Copyright (c) 2022 SomeRandomiOSDev. All Rights Reserved. -->
150+
<!-- Copyright (c) 2023 SomeRandomiOSDev. All Rights Reserved. -->

Sources/Half/Half.docc/Half.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Swift Half-Precision Floating Point
1212

1313
- <doc:Standard-Library-Functions>
1414

15-
<!-- Copyright (c) 2022 SomeRandomiOSDev. All Rights Reserved. -->
15+
<!-- Copyright (c) 2023 SomeRandomiOSDev. All Rights Reserved. -->

Sources/Half/Half.docc/Standard-Library-Functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ Functions provided by this library with custom implementations for the ``Half/Ha
4343
- ``tanh(_:)``
4444
- ``tgamma(_:)``
4545

46-
<!-- Copyright (c) 2022 SomeRandomiOSDev. All Rights Reserved. -->
46+
<!-- Copyright (c) 2023 SomeRandomiOSDev. All Rights Reserved. -->

Sources/Half/Half.docc/half_t.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
A C structure for representing the low-level structure used for a half-precision floating-point value.
44

5-
<!-- Copyright (c) 2022 SomeRandomiOSDev. All Rights Reserved. -->
5+
<!-- Copyright (c) 2023 SomeRandomiOSDev. All Rights Reserved. -->

Sources/Half/Half.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Half.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
#if SWIFT_PACKAGE

Tests/CHalfTests/CHalfTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// CHalfTests.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
#if SWIFT_PACKAGE

Tests/HalfTests/FunctionsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// FunctionsTests.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
@testable import Half

Tests/HalfTests/Half+CodingTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Half+CodingTests.swift
33
// Half
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
@testable import Half
@@ -153,3 +153,5 @@ class HalfCodingTests: XCTestCase {
153153
}
154154
}
155155
}
156+
157+
// swiftlint:enable function_body_length

Tests/HalfTests/HalfTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// HalfTests.swift
33
// HalfTests
44
//
5-
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
5+
// Copyright © 2023 SomeRandomiOSDev. All rights reserved.
66
//
77

88
@testable import Half
@@ -503,3 +503,5 @@ extension HalfTests: TextOutputStream {
503503
XCTAssertEqual(string, "2.5")
504504
}
505505
}
506+
507+
// swiftlint:enable function_body_length

scripts/carthage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# carthage.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./carthage.sh build --platform iOS
77
#

scripts/findproject.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# findproject.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./findproject.sh --project-name <project_name>
77

scripts/printformat.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# printformat.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./formatstring.sh "forground:red;bold" "Hello, World"
77
#

scripts/resolvepath.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# resolvepath.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./resolvepath.sh "./some/random/path/../../"
77

scripts/versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# versions.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./versions.sh "1.4.15" "1.7.0"
77

scripts/workflowtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# workflowtests.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./workflowtests.sh --no-clean
77

scripts/xcframework.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# xcframework.sh
4-
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
4+
# Copyright © 2023 SomeRandomiOSDev. All rights reserved.
55
#
66
# Usage example: ./xcframework.sh --output <some_path>/<name>.xcframework
77

0 commit comments

Comments
 (0)