You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
247 B
15 lines
247 B
# 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()))
|
|
|