Skip to content

Commit

Permalink
Clarify purpose of norm keyword argument in isapprox docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
sloede committed May 14, 2020
1 parent abcb76e commit 8080688
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,8 @@ the square root of [`eps`](@ref) of the type of `x` or `y`, whichever is bigger
This corresponds to requiring equality of about half of the significand digits. Otherwise,
e.g. for integer arguments or if an `atol > 0` is supplied, `rtol` defaults to zero.
If `x` and `y` are scalar values (i.e., numbers), `norm` defaults to `abs`, but
may be changed by passing a `norm::Function` keyword argument.
`x` and `y` may also be arrays of numbers, in which case `norm` defaults to the usual
`norm` function in LinearAlgebra.
The `norm` keyword defaults to `abs` for numeric `(x,y)` and to `LinearAlgebra.norm` for
arrays (where an alternative `norm` choice is sometimes useful).
When `x` and `y` are arrays, if `norm(x-y)` is not finite (i.e. `±Inf`
or `NaN`), the comparison falls back to checking whether all elements of `x` and `y` are
approximately equal component-wise.
Expand Down

0 comments on commit 8080688

Please sign in to comment.