Skip to content

Commit 25f8f73

Browse files
authored
Expand explanation of Preferences (#598)
1 parent 6a6443b commit 25f8f73

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/src/user/advanced.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,24 @@ julia> using ForwardDiff, Preferences
154154
julia> set_preferences!(ForwardDiff, "nansafe_mode" => true)
155155
```
156156

157+
Note that Julia has to be restarted and ForwardDiff has to be reloaded after changing
158+
this preference.
159+
160+
Alternatively, you can set the preference before loading ForwardDiff, for example via:
161+
162+
```julia
163+
julia> using Preferences, UUIDs
164+
165+
julia> set_preferences!(UUID("f6369f11-7733-5829-9624-2563aa707210"), "nansafe_mode" => true)
166+
167+
julia> using ForwardDiff
168+
169+
julia> log(ForwardDiff.Dual{:tag}(0.0, 0.0))
170+
Dual{:tag}(-Inf,0.0)
171+
```
172+
157173
In the future, we plan on allowing users and downstream library authors to dynamically
158-
enable [NaN`-safe mode via the `AbstractConfig`
174+
enable [`NaN`-safe mode via the `AbstractConfig`
159175
API](https://github.com/JuliaDiff/ForwardDiff.jl/issues/181).
160176

161177
## Hessian of a vector-valued function

0 commit comments

Comments
 (0)