Using doctest-mode inside rst-mode (3/4)

If you move your cursor inside the docstring, the modeline will change from "(reST MMM Font)" to "(reST[Doctest] MMM Font)", signifying that you are now using doctest-mode.

Next Page...

Regression Tests for math
=========================
This is a mock-up file containing some regression tests for
the Python `math module`_.

.. _math module: http://docs.python.org/lib/module-math.html

>>> from math import *

Make sure that `math.floor()` handles negative numbers
correctly:

>>> [floor(x) for x in (-2.0, -1.5, -1.0, 1.0, 1.5, 2.0)]
[-2.0, -2.0, -1.0, 1.0, 1.0, 2.0].

Check for rounding errors on round trips:

>>> print sin(asin(0.5)), cos(acos(0.5))
0.5 0.5
ISO8---Emacs: mytest.rst   (reST MMM Font)----L14--All-----------