summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/math_dunder.py
blob: 33ea7f7c1c10512bdb5b180017acf4f66fd0c24e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# test that math functions support user classes with __float__

try:
    import math
except ImportError:
    print("SKIP")
    raise SystemExit


class TestFloat:
    def __float__(self):
        return 1.0


print("%.5g" % math.exp(TestFloat()))