FAQ: Difference between revisions

Jump to navigation Jump to search
126 bytes added ,  4 March 2013
Line 520: Line 520:
<syntaxhighlight lang="Octave">uint64(18446744073709551610);</syntaxhighlight>
<syntaxhighlight lang="Octave">uint64(18446744073709551610);</syntaxhighlight>


the literal "18446744073709551610" first gets converted to a double precision type, so <code>uint64</code>'s additional precision is lost. Alternatively, the symbolic package, when it works, has a vpa() function for variable-precision arithmetic. Note that arbitrary-precision arithmetic is implemented '''in software''' which makes it much slower than hardware floats.
the literal "18446744073709551610" first gets converted to a double precision type, so <code>uint64</code>'s additional precision is lost. Instead, initialise the <code>uint64</code> with smaller numbers and perform a computation to get the larger number you want. Alternatively, the symbolic package, when it works, has a vpa() function for variable-precision arithmetic. Note that arbitrary-precision arithmetic is implemented '''in software''' which makes it much slower than hardware floats.


At present, however, the symbolic package is almost useless, since even when you get it to compile and not crash, it cannot handle any array type, which hardly helps for an array-oriented language like Octave. If this limitation is not important to you, attempt to use the symbolic package. If you would like to get this fixed, [http://octave.1599824.n4.nabble.com/Internal-Precision-Symbolic-tp4645257p4645594.html Jordi Gutiérrez Hermoso has volunteered] to fix the package for 5000 USD, which can be obtained from a kickstarter compaign.
At present, however, the symbolic package is almost useless, since even when you get it to compile and not crash, it cannot handle any array type, which hardly helps for an array-oriented language like Octave. If this limitation is not important to you, attempt to use the symbolic package. If you would like to get this fixed, [http://octave.1599824.n4.nabble.com/Internal-Precision-Symbolic-tp4645257p4645594.html Jordi Gutiérrez Hermoso has volunteered] to fix the package for 5000 USD, which can be obtained from a kickstarter compaign.

Navigation menu