summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Karen Sargsyan <karsar@ibms.sinica.edu.tw>2016-05-21 18:00:59 +0800
committerGravatar Karen Sargsyan <karsar@ibms.sinica.edu.tw>2016-05-21 18:00:59 +0800
commit22527df1714c83e968913dabba4ba3ec81adc20c (patch)
tree9dafbbb36b0d25200b70a92e1aca8f6f0ae2f583 /tests
parent02724f709fcafa9f4e854c271df6c2f79fd9cfa6 (diff)
Some basic math functions: pow, sqrt, sin, cos, log, exp are added to work at client and server sides
Diffstat (limited to 'tests')
-rw-r--r--tests/math.ur14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/math.ur b/tests/math.ur
new file mode 100644
index 00000000..8892fffe
--- /dev/null
+++ b/tests/math.ur
@@ -0,0 +1,14 @@
+fun main () = return <xml><body>
+ <button value="Power 2.0 of 2.0!" onclick={fn _ => alert (show (pow 2.0 2.0))}/>
+ {[(pow 2.0 2.0)]}
+ <button value="Square root of 25!" onclick={fn _ => alert (show (sqrt 25.0))}/>
+ {[(sqrt 25.0)]}
+ <button value="Sin of 0.1!" onclick={fn _ => alert (show (sin 0.1))}/>
+ {[(sin 0.1)]}
+ <button value="Cos of 0.1!" onclick={fn _ => alert (show (cos 0.1))}/>
+ {[(cos 0.1)]}
+ <button value="log of 0.1!" onclick={fn _ => alert (show (log 0.1))}/>
+ {[(log 0.1)]}
+ <button value="Exp of 0.1!" onclick={fn _ => alert (show (exp 0.1))}/>
+ {[(exp 0.1)]}
+ </body></xml>