"""Compute consecutive percentage returns.

Prices must be positive; a return is measured against the preceding price.
All inputs are synthetic teaching examples. Run: python 01_simple-returns.py
"""
from tv_math import *

r=returns([100,110,99])
assert abs(r[0]-.1)<1e-12 and abs(r[1]+.1)<1e-12
print(r)
