title: Output of a function in maxima
body: <p>I have programmed a function F which round the input following some specific rules. For example, if my input is <code>F(0.1355)</code> it gives as output <code>1.4b-1</code>. The problem is that, when I do <code>F(0.1355)^2</code>, it gives me <code>1.96382999420166b-2</code>, when it should give me 0.14^2, i.e, <code>1.96b-2</code>. Why is this happening? and, how can I fix it?</p>
  
  <p>This is the code of my function:</p>
  
  <pre><code>F(x):=(block ([log10,aaa,fpprec],log10(x):=entier(log(x)/log(10)), 
      vnorm(x):= if x/(10^(log10(x)))&lt;2 then 1/(10^(log10(x)-1)) else 1/10^(log10(x)),
       aaa(x):= x*vnorm(x),
      fpprec:if aaa(x)&lt;20 then 2 else 1,bfloat((round(aaa(x)))*1/vnorm(x)))); `
  </code></pre>
  
  <p>More info: I <strong>can't</strong> declare fpprec as global variable. I know that would solve my problem.
  Best regards,</p>
  
  <p>Lievet.</p>