Scientific Calculator - Calculate mathematical expressions with scrollable high accuracy/precision up to 1,000,000 digits.

You can scroll through the result by dragging, using the mouse wheel, and arrow keys.

Loading Calculator...

Loading...

Features

Notes

Performance Tips

Optimization Tips

Instructions for using Custom Variables and Functions

CRCalc.js calculator supports defining variables x, y, z, and custom functions f, g.

1. Variables x, y, z

2. Functions f, g

3. Notes on Custom Variables and Functions

  1. When defining, all variables and functions used are inlined
    When defining a variable/function, other variables/functions appearing in the definition WILL BE DIRECTLY EXPANDED using the value/expression from the definition. After that, changing a referenced variable/function WILL NOT affect variables/functions that have already been defined.

    Example 1:

    1. Define x = 2.
    2. Define y = x + 1.
      At this point, y is INLINED as 2 + 1, i.e., y = 3.
    3. Redefine x = 10.
      y is still 3, it WILL NOT become 11.

    Example 2:

    1. Define x = 3.
    2. Define f(x) = x^2 + 1.
      Here, x is the function parameter and will not be inlined as 3.
    3. Define y = 5.
    4. Define g(x) = f(x) + y.
      At this point, g INLINES the current definitions of f and y, resulting in g(x) = x^2 + 1 + 5.
    5. After modifying f or y, g WILL NOT change accordingly.
  2. In the function definition, x is the parameter
    • When defining a function, x in the function body is treated as a placeholder for parameters, and is NOT inlined as the variable x.
    • When calling a function, the argument replaces this x.
    • If you want to use variables in a function body, use y or z, not x, or it will be treated as parameter.
  3. The order of definitions is important
    • First define the referenced variables/functions, then define new variables/functions.
    • If a variable/function that has not yet been defined is referenced in the definition, an error will be raised.
    • Since definitions are inlined, subsequent changes to base variables/functions WILL NOT automatically update already defined upper-level variables/functions.
  4. Recursion is not supported
    Referencing self in function definitions WILL NOT work as expected.
Open Source Licenses | Report bugs | 中文 | Download Offline Version