From 23b7f4ef1828ff62d951585bf2857588fece771f Mon Sep 17 00:00:00 2001 From: ychenfo Date: Sat, 2 Apr 2022 03:29:25 +0800 Subject: [PATCH] nac3standalone: add tests for power --- nac3standalone/demo/src/pow.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 nac3standalone/demo/src/pow.py diff --git a/nac3standalone/demo/src/pow.py b/nac3standalone/demo/src/pow.py new file mode 100644 index 00000000..d17abd73 --- /dev/null +++ b/nac3standalone/demo/src/pow.py @@ -0,0 +1,26 @@ +@extern +def output_float64(f: float): + ... + + +def run() -> int32: + output_float64(float(3 ** 1)) + output_float64(float(3 ** 0)) + output_float64(float(3 ** 19)) + output_float64(1.0 ** -100) + output_float64(1.0 ** -2) + output_float64(1.0 ** 0) + output_float64(1.0 ** 1) + output_float64(1.0 ** 100) + output_float64(3.0 ** 0) + output_float64(3.0 ** 1) + output_float64(3.0 ** 2) + output_float64(3.0 ** -1) + output_float64(3.0 ** -2) + output_float64(3.0 ** -32767) + output_float64(3.0 ** -3.0) + output_float64(3.0 ** -0.0) + output_float64(3.0 ** 0.0) + output_float64(4.0 ** 0.5) + output_float64(4.0 ** -0.5) + return 0 \ No newline at end of file