You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/forlab_math.md
+122-64
Original file line number
Diff line number
Diff line change
@@ -6,70 +6,6 @@ title: MATH
6
6
7
7
[TOC]
8
8
9
-
### `is_close`
10
-
11
-
#### Description
12
-
13
-
Returns a boolean scalar/array where two scalars/arrays are element-wise equal within a tolerance.
14
-
15
-
The tolerance values are positive, typically very small numbers. The relative difference `(rtol*abs(b))` and the absolute difference `atol` are added together to compare against the absolute difference between `a` and `b`.
16
-
17
-
```fortran
18
-
!> For `real` type
19
-
abs(a - b) <= rtol*abs(b) + atol
20
-
!> For `complex` type
21
-
abs(a%re - b%re) <= rtol*abs(b%re) + atol
22
-
abs(a%im - b%im) <= rtol*abs(b%im) + atol
23
-
```
24
-
25
-
#### Syntax
26
-
27
-
`bool = [[forlab_math(module):is_close(interface)]] (a, b [, rtol, atol])`
28
-
29
-
#### Status
30
-
31
-
Experimental.
32
-
33
-
#### Class
34
-
35
-
Elemental function.
36
-
37
-
#### Arguments
38
-
39
-
`a`: Shall be a `real/complex` scalar/array.
40
-
This argument is `intent(in)`.
41
-
42
-
`b`: Shall be a `real/complex` scalar/array.
43
-
This argument is `intent(in)`.
44
-
45
-
`rtol`: Shall be a `real` scalar.
46
-
This argument is `intent(in)` and `optional`, which is `1.0e-5` by default.
47
-
48
-
`atol`: Shall be a `real` scalar.
49
-
This argument is `intent(in)` and `optional`, which is `1.0e-8` by default.
50
-
51
-
Note: All `real/complex` arguments must have same `kind`.
52
-
If the value of `rtol/atol` is negative (not recommended), it will be corrected to `abs(rtol/atol)` by the internal process of `is_close`.
0 commit comments