perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r30262 - trunk/src/ops

Subject: [svn:parrot] r30262 - trunk/src/ops
From:
Date: Sat, 16 Aug 2008 02:40:27 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: julianalbo
Date: Sat Aug 16 02:40:24 2008
New Revision: 30262

Modified:
   trunk/src/ops/io.ops

Log:
some cleaning of numeric print and say opcodes

Modified: trunk/src/ops/io.ops
==============================================================================
--- trunk/src/ops/io.ops        (original)
+++ trunk/src/ops/io.ops        Sat Aug 16 02:40:24 2008
@@ -169,7 +169,7 @@
 }
 
 inline op print(in NUM) :base_io {
-  PIO_printf(interp, "%f", (double)$1);
+  PIO_printf(interp, FLOATVAL_FMT, $1);
 }
 
 op print(in STR) :base_io {
@@ -198,13 +198,11 @@
 =cut
 
 inline op say(in INT) :base_io {
-  PIO_printf(interp, INTVAL_FMT, (INTVAL)$1);
-  PIO_puts(interp, _PIO_STDOUT(interp), "\n");
+  PIO_printf(interp, INTVAL_FMT "\n", (INTVAL)$1);
 }
 
 inline op say(in NUM) :base_io {
-  PIO_printf(interp, "%f", (double)$1);
-  PIO_puts(interp, _PIO_STDOUT(interp), "\n");
+  PIO_printf(interp, FLOATVAL_FMT "\n", $1);
 }
 
 op say(in STR) :base_io {
@@ -244,7 +242,7 @@
 }
 
 op printerr(in NUM) :base_io {
-  PIO_eprintf(interp, "%f", (double)$1);
+  PIO_eprintf(interp, FLOATVAL_FMT, $1);
 }
 
 op printerr(in STR) :base_io {
@@ -283,7 +281,7 @@
 
 op print(invar PMC, in NUM) :base_io {
   if ($1) {
-    STRING * const s = Parrot_sprintf_c(interp, "%f", (double)$2);
+    STRING * const s = Parrot_sprintf_c(interp, FLOATVAL_FMT, $2);
     PIO_putps(interp, $1, s);
   }
 }

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r30262 - trunk/src/ops, julianalbo <=