From 2a9a0081829b2a4cf96e5b584f63ff1510ab6fcd Mon Sep 17 00:00:00 2001 From: Nicholas Bauer Date: Fri, 26 Apr 2024 16:57:01 -0400 Subject: [PATCH] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b56d29..e6acc9e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/check `@default_checked` and `@default_unchecked` create shadow copies of the `+`, `-`, `*`, `^`, and `abs` functions that redirect to overflow-checked or overflow-permissive operations, respectively, within the module it was executed in. All non-integer arguments are passed through to their -respective Base methods. +respective Base methods. **Important:** The first usage this macro must occur earlier than the first usage of the affected Base functions. The expression-level `@checked` and `@unchecked` rewrite instances of `+`, `-`, `*`, `^`, and `abs` functions, to functions specific to the checked or permissive operation, and thus are not affected by switching the default. Symbols for the functions will also be replaced, to support @@ -18,6 +18,8 @@ context and vice versa. ```julia using OverflowContexts +@default_unchecked # Julia default, but need to place first so later usages will work + x = typemax(Int) # 9223372036854775807 x + 1 # -9223372036854775808