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 <[email protected]>
1+
Copyright (c) 2023 Joe Newton <[email protected]>
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. -->

0 commit comments

Comments
 (0)