abacus alternatives and similar packages
Based on the "Text and Numbers" category.
Alternatively, view abacus alternatives based on common mentions on social networks and blogs.
-
money
Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog. -
nanoid
Elixir port of NanoID, a secure and URL-friendly unique ID generator. https://hex.pm/packages/nanoid -
secure_random
Convenience library for random base64 strings modeled after my love for Ruby's SecureRandom -
chinese_translation
An elixir module to translate simplified Chinese to traditional Chinese, and vice versa, based on wikipedia data -
inet_cidr
CIDR library for Elixir that is compatible with Erlang's :inet and supports both IPv4 and IPv6 -
Ex_Cldr_Units
Unit formatting (volume, area, length, ...) functions for the Common Locale Data Repository (CLDR) -
minigen
Pure random data generation library, appropriate for realistic simulations in the Erlang ecosystem
CodeRabbit: AI Code Reviews for Developers
Do you think we are missing an alternative of abacus or a related project?
Popular Comparisons
README
Abacus
A parser for mathematical expressions.
https://hex.pm/packages/abacus
Usage
Abacus.eval(expression, scope)
Parses and evaluates the given expression. Variables can be supplied as a map of
binaries in the scope
.
Examples
iex> Abacus.eval("1 + 1")
{:ok, 2}
iex> Abacus.eval("sin(floor(3 + 2.5)) / 3")
{:ok, -0.3196414248877128}
iex> Abacus.eval("a * b", %{"a" => 10, "b" => 10})
{:ok, 100}
Abacus.parse(expression)
Parses the expression and returns the syntax tree.
Features
An incomplete list of supported and planned features
- [x] basic operators (
+
,-
,*
,/
,^
) - [x] factorial (
!
) - [x] bitwise operators (
|
,&
,>>
,<<
,~
,|^
(xor)) - [x] support for functions
- [x] trigonometric functions(
sin
,cos
,tan
) - [x] floating point manipulation(
ceil
,floor
,round
)
- [x] trigonometric functions(
- [x] support for variables
- [ ] support for parsing units
- [ ] support for converting units
Installation
Add
abacus
to your list of dependencies inmix.exs
:def deps do [{:abacus, "~> 0.4.2"}] end
Ensure
abacus
is started before your application:def application do [applications: [:abacus]] end