<?xml version="1.0" encoding="windows-1252"?>
<node id="534919" title="Re: Hexadecimal representation of pi" created="2006-03-07 08:53:16" updated="2006-03-07 03:53:16">
<type id="11">
note</type>
<author id="295576">
ambrus</author>
<data>
<field name="doctext">
&lt;p&gt;
As you're golfing, there are a few trivial modifications that can save a few characters (update: 4 characters).  Omit the semicolons after the &lt;c&gt;sub&lt;/c&gt; definitions and &lt;c&gt;for&lt;/c&gt; loops, and change &lt;c&gt;($/*=16)%=O&lt;/c&gt; to &lt;c&gt;$/=$/*16%O&lt;/c&gt;.
&lt;readmore&gt;
&lt;c&gt;

        $|=print 3.2;sub O{8*($@-$_)+(1,4,5,6)[$:]}sub 
       o{(-4,2,1,1)[$:]/O}while($,=++$@){for$:(0..3){
      for         (0..$@)             {for$"
                  (($/=1)             ..$_){
                  $/=$/*              16%O}
                 $,-=$/                *o}$,
                 -=16**                 $_*o
               for-6..-                   1}printf
             "%x",$,*                   16%16}

&lt;/c&gt;
&lt;/readmore&gt;

</field>
<field name="root_node">
534891</field>
<field name="parent_node">
534891</field>
</data>
</node>
