-
SigFigs
Implementation of a Sigfig class and an Exact class that allow math to be done while keeping the correct number of significant digits.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
As a hard science major, I've lost a lot of points on lab reports to significant figures, so I figured I'd use it as a means to finally learn how classes work. [I created a class](https://github.com/AviBodzin/SigFigs/blob/main/sigfigs.py) that **should** perform the four basic operations while keeping track of the correct number of significant figures. There is also a class that allows for exact numbers, which are treated as if having an infinite number of significant figures. I thought about the possibility of making Exact a subclass of Sigfig to increase the value of the learning exercise, but I didn't see the use given that all of the functions had to work differently. I think that everything works, but it feels like there are a million possible cases. Feel free to ask questions or (kindly please) suggest improvements.
Probably the most popular package for dealing with error propagation and arbitrary precision arithmetic in Python is mpmath, more specifically the mp.iv module. For more serious applications I'd take a look at MPFR and Arb, both in C. And there are tons of ball arithmetic and interval arithmetic libraries in Fortran.
Probably the most popular package for dealing with error propagation and arbitrary precision arithmetic in Python is mpmath, more specifically the mp.iv module. For more serious applications I'd take a look at MPFR and Arb, both in C. And there are tons of ball arithmetic and interval arithmetic libraries in Fortran.
Related posts
-
mpmath – Python library for arbitrary-precision floating-point arithmetic
-
Lies My Calculator and Computer Told Me [pdf]
-
mpmath VS gmpy - a user suggested alternative
2 projects | 2 Aug 2023 -
How can I compute the Mandelbrot Set at infinite zoom level
-
How do I get more decimal places for numbers in Python?