mpfr-binary-operators.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <html lang="en">
  2. <head>
  3. <title>mpfr binary operators - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="mpfr.html#mpfr" title="mpfr">
  9. <link rel="prev" href="mpfr.html#mpfr" title="mpfr">
  10. <link rel="next" href="mpfr-unary-operators.html#mpfr-unary-operators" title="mpfr unary operators">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="mpfr-binary-operators"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="mpfr-unary-operators.html#mpfr-unary-operators">mpfr unary operators</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="mpfr.html#mpfr">mpfr</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="mpfr.html#mpfr">mpfr</a>
  32. <hr>
  33. </div>
  34. <h4 class="subsection">D.14.1 <code>mpfr</code> binary operators</h4>
  35. <p>Functions with these names take a pair of <code>mpfr</code> numbers
  36. <code>(</code><var>x</var><code>,</code><var>y</var><code>)</code> and return an <code>mpfr</code> number as a result.
  37. <ul>
  38. <li><code>add</code>
  39. <li><code>sub</code>
  40. <li><code>mul</code>
  41. <li><code>div</code>
  42. <li><code>pow</code>
  43. <li><code>atan2</code>
  44. <li><code>hypot</code>
  45. <li><code>min</code>
  46. <li><code>max</code>
  47. <li><code>vid</code>
  48. <li><code>bus</code>
  49. </ul>
  50. <p>Their semantics are similar to those listed in the <code>mpfr</code>
  51. documentation, with some minor qualifications.
  52. <ul>
  53. <li>Unlike the native API, there is no third argument to which the result
  54. is assigned, because the result is the returned value.
  55. <li>The precision of the result is the greater of the two precisions of
  56. the input numbers <var>x</var> and <var>y</var>.
  57. <li>The <code>vid</code> and <code>bus</code> functions are added features of the
  58. virtual code interface, corresponding to division and subtraction with
  59. the order of the operands reversed, as explained in <a href="complex.html#complex">complex</a>.
  60. </ul>
  61. <p>Mathematically it might make more sense for the precision of the
  62. <a name="index-precision-793"></a>result to be the lesser of the two input precisions, but this way is
  63. more convenient for virtual code programs that perform binary
  64. operations on their input with hard coded constants, because it makes
  65. one size fit all.
  66. </body></html>