[svn:parrot] r47167 - trunk/t/pmc

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sun May 30 17:07:38 UTC 2010


Author: plobsing
Date: Sun May 30 17:07:38 2010
New Revision: 47167
URL: https://trac.parrot.org/parrot/changeset/47167

Log:
use something other than Pi for an irrational. avoids the use of dynop atan

Modified:
   trunk/t/pmc/sub.t

Modified: trunk/t/pmc/sub.t
==============================================================================
--- trunk/t/pmc/sub.t	Sun May 30 17:02:14 2010	(r47166)
+++ trunk/t/pmc/sub.t	Sun May 30 17:07:38 2010	(r47167)
@@ -991,22 +991,22 @@
 unlink( $l1_pbc, $l2_pbc );
 
 pir_output_is( <<'CODE', <<'OUTPUT', "immediate code as const" );
-.loadlib 'trans_ops' # for atan
-.sub make_pi :immediate :anon
-    $N0 = atan 1.0, 1.0
-    $N0 *= 4
+.sub make_phi :immediate :anon
+    $N0 = sqrt 5
+    $N0 += 1
+    $N0 /= 2
     $P0 = new ['Float']
     $P0 = $N0
     .return ($P0)
 .end
 
 .sub main :main
-    .const 'Sub' pi = "make_pi"
-    print pi
+    .const 'Sub' phi = "make_phi"
+    print phi
     print "\n"
 .end
 CODE
-3.14159265358979
+1.61803398874989
 OUTPUT
 
 pir_output_is( <<'CODE', <<'OUTPUT', "immediate code as const - obj" );


More information about the parrot-commits mailing list