develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34116 - trunk/languages/perl6/src/builtins

From:
moritz
Date:
December 19, 2008 13:02
Subject:
[svn:parrot] r34116 - trunk/languages/perl6/src/builtins
Message ID:
20081219210211.55D89CBA12@x12.develooper.com
Author: moritz
Date: Fri Dec 19 13:02:10 2008
New Revision: 34116

Modified:
   trunk/languages/perl6/src/builtins/math.pir

Log:
[rakudo] make ceil(), floor() etc. return Int values, not Num. cspencer++,
patch courtesy by Cory Spencer (cspencer at sprocket.org). Closes RT #61526.


Modified: trunk/languages/perl6/src/builtins/math.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/math.pir	(original)
+++ trunk/languages/perl6/src/builtins/math.pir	Fri Dec 19 13:02:10 2008
@@ -25,9 +25,10 @@
 =cut
 
 .sub 'floor'
-    .param num a
-    floor a
-    .return (a)
+    .param num n
+    .local int i
+    floor i, n
+    .return (i)
 .end
 
 
@@ -41,9 +42,10 @@
 =cut
 
 .sub 'ceiling'
-    .param num a
-    ceil a
-    .return (a)
+    .param num n
+    .local int i
+    ceil i, n
+    .return (i)
 .end
 
 
@@ -58,10 +60,11 @@
 =cut
 
 .sub 'round'
-    .param num a
-    a += 0.5
-    $N0 = floor a
-    .return ($N0)
+    .param num n
+    .local int i
+    n += 0.5
+    floor i, n
+    .return (i)
 .end
 
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About