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

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

From:
pmichaud
Date:
November 12, 2008 07:51
Subject:
[svn:parrot] r32574 - trunk/languages/perl6/src/builtins
Message ID:
20081112155152.3831BCB9AF@x12.develooper.com
Author: pmichaud
Date: Wed Nov 12 07:51:50 2008
New Revision: 32574

Modified:
   trunk/languages/perl6/src/builtins/any-num.pir

Log:
[rakudo]:  Make log(0) return a Failure (RT #60490, masak++)


Modified: trunk/languages/perl6/src/builtins/any-num.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/any-num.pir	(original)
+++ trunk/languages/perl6/src/builtins/any-num.pir	Wed Nov 12 07:51:50 2008
@@ -77,9 +77,12 @@
 =cut
 
 .sub 'log' :method :multi(_)
+    if self == 0 goto fail
     $N0 = self
     $N1 = ln $N0
     .return ($N1)
+  fail:
+    .tailcall '!FAIL'("Can't take log of 0")
 .end
 
 



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