Giter Site home page Giter Site logo

Comments (2)

hanna-kn avatar hanna-kn commented on August 20, 2024

This is already supported by the "read precision" (readprec) setting. This can be activated in qalc using set readprec. The number of significant digits in output can be changed using the precision or max decimals settings.

> help readprec

read precision (readprec)
If activated, numbers are interpreted as approximate with precision equal to the number of significant digits
(3.20 = 3.20+/-0.005).
(0* = off, 1 = always, 2 = when decimals)

> set readprec
> 1.23*2.1

  ≈ 1.2300±0.0050 × 2.100±0.050 ≈ 2.583±0.062

Qalculate also supports specification of the precision/uncertainty/error of a value using ± (or +/-), or the interval() and uncertainty() functions.

By default the precision of the result (uncertainty propagation) is determined using the variance formula, but interval arithmetic can also be used (this is controlled by the "interval arithmetic", or ia, setting). The common simple method of using the same number of significant digits in output as the number with the least number of significant digits in input is not supported.

With "read precision" enabled 1.23*2.1 will return 2.583±0.062 (or 2.583±0.072 with interval arithmetic enabled). Note that ± will by default be omitted for values with higher precision (e.g. 1.23 * 2.10 ≈ 2.6)

from libqalculate.

SS-KyleSam avatar SS-KyleSam commented on August 20, 2024

Apologies for adding a request without doing the proper research. The real implantation is better than what I requested.

from libqalculate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.