All Projects → Vonmo → eapa

Vonmo / eapa

Licence: other
Erlang/Elixir Arbitrary-Precision Arithmetic (EAPA)

Programming Languages

erlang
1774 projects
rust
11053 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to eapa

Calc
C-style arbitrary precision calculator
Stars: ✭ 127 (+252.78%)
Mutual labels:  arbitrary-precision
hyperbeam
Experimental NIF-based HTTP Server for the BEAM
Stars: ✭ 22 (-38.89%)
Mutual labels:  nif
webview
Build cross platform desktop apps with Elixir and web technologies.
Stars: ✭ 18 (-50%)
Mutual labels:  nif
Big Math
Advanced Java BigDecimal math functions (pow, sqrt, log, sin, ...) using arbitrary precision.
Stars: ✭ 173 (+380.56%)
Mutual labels:  arbitrary-precision
Measurements.jl
Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.
Stars: ✭ 248 (+588.89%)
Mutual labels:  arbitrary-precision
franz
A Kafka client library for Erlang/Elixir based on librdkafka implemented as a safe Rust NIF.
Stars: ✭ 30 (-16.67%)
Mutual labels:  nif
Physicalconstants.jl
Collection of fundamental physical constants with uncertainties. It supports arbitrary-precision constants
Stars: ✭ 55 (+52.78%)
Mutual labels:  arbitrary-precision
decimal
An arbitrary-precision decimal floating-point arithmetic package for Go
Stars: ✭ 28 (-22.22%)
Mutual labels:  arbitrary-precision
gerlang
Calling Go functions from Erlang
Stars: ✭ 26 (-27.78%)
Mutual labels:  nif
apint
Arbitrary precision integers library.
Stars: ✭ 23 (-36.11%)
Mutual labels:  arbitrary-precision
Javascript Biginteger
A big integer library for JavaScript
Stars: ✭ 181 (+402.78%)
Mutual labels:  arbitrary-precision
Decimal.js Light
The light version of decimal.js, an arbitrary-precision Decimal type for JavaScript.
Stars: ✭ 237 (+558.33%)
Mutual labels:  arbitrary-precision
better-dni
The fastest Spanish DNI (NIE / NIF) validation out there.
Stars: ✭ 23 (-36.11%)
Mutual labels:  nif
Swift Bigint
A lightweight, Multiple Precision Arithmetic Library for Swift!
Stars: ✭ 144 (+300%)
Mutual labels:  arbitrary-precision
math
Complex special functions and common mathematical operations in JavaScript
Stars: ✭ 42 (+16.67%)
Mutual labels:  arbitrary-precision
Kotlin Multiplatform Bignum
A Kotlin multiplatform library for arbitrary precision arithmetics
Stars: ✭ 119 (+230.56%)
Mutual labels:  arbitrary-precision
Rustler
Safe Rust bridge for creating Erlang NIF functions
Stars: ✭ 3,052 (+8377.78%)
Mutual labels:  nif
UIX-R
Ultima IX: Redemption for Morrowind and OpenMW
Stars: ✭ 32 (-11.11%)
Mutual labels:  nif
hebimath
arbitrary precision arithmetic library
Stars: ✭ 37 (+2.78%)
Mutual labels:  arbitrary-precision
exor filter
Erlang nif for xor_filter. 'Faster and Smaller Than Bloom and Cuckoo Filters'.
Stars: ✭ 29 (-19.44%)
Mutual labels:  nif

eapa

Erlang/Elixir Arbitrary Precision Arithmetic

release: make up && make rel or rebar3 as prod release

test: make tests or rebar3 as test ct

rebar deps for external projects:

{deps, [
  {eapa, "", {git, "https://github.com/Vonmo/eapa.git", {tag, "v0.1.2"}}}
]}.  

mix deps (Elixir):

defp deps do
 [
   {:eapa, git: "https://github.com/Vonmo/eapa.git", tag: "v0.1.2"}      
 ]
end

Introduction

Most of modern microprocessors are made with a hardware implementation of real number representation in IEEE754. The number length is limited by the format, and rounding modes influence precision. Programmers are often unable to change the behaviour of equipment, or languages implementation. For example, the official implementation of Erlang stores float in 3 words on a 64-bit machine and in 4 words on a 32-bit one.

IEEE754 numbers are an infinite set represented as finite. That's why every operand can be misrepresented in IEEE754.

Most numbers when represented as a finite set have stable minimal relative error. For instance, it is 11,920928955078125e-6% for a float and 2,2204460492503130808472633361816e-14% for a double. Most programmers can afford to neglect such an error, though it should be mentioned that you can be caught in the same trap because the rate of an absolute error might be up to 10^31 and 10^292 for a float and a double respectively. It can be troublesome for your computing.

EAPA

EAPA is a NIF extension written on Rust. So far, in EAPA repository there is an eapa_int interface. It is as simple as possible, as well as the most convenient. This interface is used for working with fixed-point numbers. Among its main features are:

  1. No effects of IEEE754 encoding
  2. Big numbers support
  3. Customized precision up to 126 decimal places (current realization)
  4. Autoscaling
  5. Support of all main numerical operations
  6. More or less complete testing, including property based one

eapa_int interface

  • with_val/2 – conversion from a float into a fixed-point representation which can be safely used with json and xml.
  • to_float/2 – conversion from a fixed-point number into a float with precision required.
  • to_float/1 – conversion from a fixed-point number into a float.
  • add/2 – sum of two numbers
  • sub/2 – difference
  • mul/2 – multiplication
  • divp/2 – division
  • min/2 – min number
  • max/2 – max number
  • eq/2 – equality
  • lt/2 – less than
  • lte/2 – less than or equals to
  • gt/2 – greater than
  • gte/2 – greater than or equals to

Development sandbox

You can play with EAPA in Docker enviroment using make:

  • make tests - run tests
  • make lint - linter
  • make xref - xref analysis
  • make prod - generate release for target
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].