-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct
to_base
and from_base
to be zero-cost for float storage t…
…ypes. For a value, `v: Float`, adding `-0.0` is a no-op while adding `0.0` will change the sign if `v` is `-0.0`. The opposite is true for subtraction. When no constant factor exists use an appropriated signed `0.0`. A new enum, `ConstantOp`, is added to allow the `constant(op: ConstantOp)` function to return an appropriately signed `0.0`. v 0.0 + -0.0 = 0.0 -0.0 + 0.0 = 0.0 // v + 0.0 != v -0.0 + -0.0 = -0.0 0.0 - -0.0 = 0.0 -0.0 - 0.0 = 0.0 -0.0 - -0.0 = 0.0 // v - -0.0 != v
- Loading branch information
1 parent
1c7dc72
commit 9f5ad77
Showing
6 changed files
with
71 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters