# HG changeset patch
# User Robert Bradshaw <robertwb@math.washington.edu>
# Date 1300429758 25200
# Node ID 029709447b87db93acff1746b570dd975ff12433
# Parent f3b747f7e8d78cd69ddaf9c7ce6509f0f6ceb607
#10952 - better handling of numerial noise in doctests
diff -r f3b747f7e8d7 -r 029709447b87 doc/en/developer/conventions.rst
|
a
|
b
|
|
| 723 | 723 | sage: E.regulator() # long time (1 second) |
| 724 | 724 | 0.0511114082399688 |
| 725 | 725 | |
| | 726 | - If a line contains ``tol`` or ``tolerance, numerical results are only |
| | 727 | verified to the given tolerance. This may be prefixed by ``abs[olute`` |
| | 728 | or ``rel[ative]`` to specify whether to measure absolute or relative |
| | 729 | error; defaults to relative error except when the expected value is |
| | 730 | exactly zero: |
| | 731 | |
| | 732 | :: |
| | 733 | |
| | 734 | sage: RDF(pi) # abs tol 1e-5 |
| | 735 | 3.14159 |
| | 736 | sage: [10^n for n in [0.0 .. 4]] # rel tol 2e-4 |
| | 737 | [0.9999, 10.001, 100.01, 999.9, 10001] |
| | 738 | |
| | 739 | This can be useful when the exact output is subject to rounding error |
| | 740 | and/or processor floating point arithmetic variation. |
| | 741 | |
| 726 | 742 | - If a line contains ``todo: not implemented``, it is never |
| 727 | 743 | tested. It is good to include lines like this to make clear what we |
| 728 | 744 | want Sage to eventually implement: |