Author: smash
Date: Thu Mar 29 13:32:46 2007
New Revision: 17845

Modified:
   trunk/languages/pynie/src/builtins/oper.pir
   trunk/languages/pynie/t/00-parrot/02-op-math.t

Log:
[languages/pynie]
 * add pow operator builtin
 * add some simple test cases


Modified: trunk/languages/pynie/src/builtins/oper.pir
==============================================================================
--- trunk/languages/pynie/src/builtins/oper.pir (original)
+++ trunk/languages/pynie/src/builtins/oper.pir Thu Mar 29 13:32:46 2007
@@ -151,6 +151,13 @@
     print "\n"
 .end
 
+.sub 'infix:**'
+    .param num a
+    .param num b
+    $N0 = pow a, b
+    .return($N0)
+.end
+
 =back
 
 =head1 AUTHOR

Modified: trunk/languages/pynie/t/00-parrot/02-op-math.t
==============================================================================
--- trunk/languages/pynie/t/00-parrot/02-op-math.t      (original)
+++ trunk/languages/pynie/t/00-parrot/02-op-math.t      Thu Mar 29 13:32:46 2007
@@ -1,6 +1,6 @@
 #!./parrot
 
-print '1..8'
+print '1..12'
 
 # basic math operators
 
@@ -14,3 +14,9 @@
 print 'ok', 3<<1
 print 'ok', 14>>1
 print 'ok', 0 // 1 + 8
+
+# ** operator
+print 'ok', 3**2
+print 'ok', 0**0+9
+print 'ok', 0**1+11
+print 'ok', 1**0+11

Reply via email to