Skip to content

Commit 117a93d

Browse files
committed
More README tweaks
1 parent 0454b45 commit 117a93d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ This package also adds a saturating mode, where values accumulate at the maximum
7373
# Evaluates to `typemax(Int64)`
7474
```
7575

76-
Broadcasted operators/methods and elementwise array operators, and assignment operators are also rewritten:
76+
Broadcasted operators/methods, elementwise array operators, and assignment operators are also rewritten:
7777
```julia
7878
@checked .-fill(typemin(Int64), 2)
7979
# Expands to `OverflowContexts.checked_neg.(fill(typemin(Int64), 2))`
@@ -89,7 +89,7 @@ a = fill(1, 2)
8989
# Evaluates to `[typemax(Int64), typemax(Int64)]`
9090
```
9191

92-
Functions passed as an argument are also rewritten:
92+
Functions passed as an argument are also supported:
9393
```julia
9494
@saturating map(-, fill(typemin(Int64), 2))
9595
# Expands to `map(OverflowContexts.saturating_neg, fill(typemin(Int64), 2))`
@@ -103,7 +103,7 @@ Julia has a more complex `div` API than is supported here (e.g. supporting round
103103

104104
## Module Default Macros
105105

106-
If you are writing a module and desire to set the default type of arithemtic for the module, place e.g., `@default_unchecked`, `@default_checked`, `@default_saturating` at the top of the module. This macro defines module-local copies of all of the supported arithemtic operators and methods, mapping them to the appropriate `checked_` or `saturating_` methods. The defaults do not affect anything inside the expression/block-level macros. These defaults may also be used on the REPL to switch between modes, although keep in mind that it will also cause previous methods defined on the REPL (in the `Main` module) to be recompiled with the new default.
106+
If you are writing a module and desire to set the default type of arithemtic for the module, place e.g., `@default_unchecked`, `@default_checked`, `@default_saturating` at the top of the module. This macro defines module-local copies of all of the supported arithemtic operators and methods, mapping them to the appropriate `unchecked`, `checked_`, or `saturating_` methods. The defaults do not affect anything inside the expression/block-level macros. These defaults may also be used on the REPL to switch between modes, although keep in mind that it will also cause previous methods defined on the REPL (in the `Main` module) to be recompiled with the new default.
107107
```julia
108108
module Foo
109109
using OverflowContexts
@@ -119,7 +119,7 @@ Foo.baz(typemax(Int64), 1)
119119

120120
# Custom Numeric Types Support
121121

122-
If you are implementing your own `Number` types, this package should just work for you so long as you extend the Base operators and the Base.Checked `checked_` methods. For `saturating_`, your package will need to either take OverflowContexts as a dependency or a weak dependency in order to import the `saturating_` methods, until/unless Julia implements them directly.
122+
If you are implementing your own `Number` types, this package should just work for you so long as you extend the Base operators and the Base.Checked `checked_` methods. For `saturating_`, your package will need to either take OverflowContexts as a dependency or a weak dependency with a package extension in order to import the `saturating_` methods, until/unless Julia implements them directly.
123123

124124
## Related Packages
125125

0 commit comments

Comments
 (0)