Skip to content

Question concerning numerical evaluation #206

Answered by axkr
pcfreak9000 asked this question in Q&A
Discussion options

You must be logged in to vote

Symja uses apfloat for arbitrary precision arithmetic.

As you can see in the apfloat tutorial there are some caveats with the double constructor.

The recommendation is to use exact number input as much as possible.

For your example you can write:

    eval.eval("a = N[425/500, 50]");
    eval.eval("u = N[295/100, 50]");

Commit #aac80f0 should fix the error in Power#e2ApfloatArg() method for negative exponents.

Note: high precision calculations are available in Symja only for the functions which apfloat support.

import org.matheclipse.core.eval.ExprEvaluator;

public class Discussion206 {
  public static void main(String[] args) {
    ExprEvaluator eval = new ExprEvaluator();
    String fun…

Replies: 2 comments 2 replies

This comment has been hidden.

@pcfreak9000
Comment options

Comment options

You must be logged in to vote
1 reply
@pcfreak9000
Comment options

Answer selected by axkr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants