{"id":26950561,"url":"https://github.com/formulae-org/package-arithmetic-js","last_synced_at":"2026-02-28T04:45:25.776Z","repository":{"id":152515269,"uuid":"625760355","full_name":"formulae-org/package-arithmetic-js","owner":"formulae-org","description":"Arithmetic package for Fōrmulæ, in JavaScript","archived":false,"fork":false,"pushed_at":"2026-02-01T03:06:51.000Z","size":254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T13:56:41.143Z","etag":null,"topics":["arbitrary-precision","arithmetic","educational-software","extensible-project","formulae","integer-division","math","mathematical-expressions","mathematics","maths","pretty-printing","programming-language","rational-arithmetic","rational-numbers","rounding","trigonometry","visualization-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/formulae-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-10T03:25:36.000Z","updated_at":"2026-02-01T03:06:54.000Z","dependencies_parsed_at":"2024-01-10T21:09:50.562Z","dependency_job_id":"b14bb8ed-e6ba-4f4e-b53b-07c387098e27","html_url":"https://github.com/formulae-org/package-arithmetic-js","commit_stats":{"total_commits":67,"total_committers":2,"mean_commits":33.5,"dds":"0.25373134328358204","last_synced_commit":"2cc33cfcb531f9a30efca9905a7fbcb02f669903"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/formulae-org/package-arithmetic-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulae-org%2Fpackage-arithmetic-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulae-org%2Fpackage-arithmetic-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulae-org%2Fpackage-arithmetic-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulae-org%2Fpackage-arithmetic-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formulae-org","download_url":"https://codeload.github.com/formulae-org/package-arithmetic-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulae-org%2Fpackage-arithmetic-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arbitrary-precision","arithmetic","educational-software","extensible-project","formulae","integer-division","math","mathematical-expressions","mathematics","maths","pretty-printing","programming-language","rational-arithmetic","rational-numbers","rounding","trigonometry","visualization-tools"],"created_at":"2025-04-02T23:30:01.852Z","updated_at":"2026-02-28T04:45:25.762Z","avatar_url":"https://github.com/formulae-org.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# package-arithmetic-js\n\nArithmetic package for the [Fōrmulæ](https://formulae.org) programming language.\n\nFōrmulæ is also a software framework for visualization, edition and manipulation of complex expressions, from many fields. The code for an specific field —i.e. arithmetics— is encapsulated in a single unit called a Fōrmulæ **package**.\n\nThis repository contains the source code for the **arithmetic package**. It is intended to the computation of many arithmetical and mathematical operations.\n\nThe GitHub organization [formulae-org](https://github.com/formulae-org) encompasses the source code for the rest of packages, as well as the [web application](https://github.com/formulae-org/formulae-js).\n\nTake a look at this [tutorial](https://formulae.org/?script=tutorials/Arithmetic) to know the capabilities of the Fōrmulæ arithmetic package.\n\n### Capabilities ###\n\n* Types of numbers\n    * [Integer numbers](https://en.wikipedia.org/wiki/Integer) of arbitrary size\n    * [Decimal numbers](https://en.wikipedia.org/wiki/Real_number), of arbitrary precision\n    * [Rational numbers](https://en.wikipedia.org/wiki/Rational_number), of arbitrary size for numerator / denominator\n* Precision management\n    * Based on [significant digits](https://en.wikipedia.org/wiki/Significant_digit)\n    * It can be set globally or by specific operation\n* [Rounding](https://en.wikipedia.org/wiki/Rounding)\n  * Rounding operation\n    * Rounding to precision. This mode is used by most operations\n  * Rounding modes. They can be set globally or by specific operation\n    * Direct, away from zero\n    * Direct, towards zero\n    * Direct, towards infinity\n    * Direct, towards minus infinity\n    * To nearest, half away from zero\n    * To nearest, half towards zero\n    * To nearest, half towards infinity\n    * To nearest, half towards minus infinity\n    * To nearest, half to even\n* \"Numeric\" operation, forces the operation to be performed with decimal arithmetic. Precision can be specified\n* Basic arithmetic operations: addition, multiplication, division and exponentiation\n   * Integer, decimal and rational numbers, even mixing them\n   * With any precision and rounding mode\n   * Division is visualized as fraction $\\frac{a}{b}$\n   * Exponentiation is visualized as $a^b$\n* Comparison between integer, decimal and rational numbers, even mixing them\n  * [Relational operators](https://en.wikipedia.org/wiki/Relational_operator) $a = b$, $a \\ne b$, $a \u003e b$, $a \u003c b$, $a \\leq b$, $a \\geq b$\n  * [Three-way comparison](https://en.wikipedia.org/wiki/Three-way_comparison) operator\n* Rationalization of decimal values. Rationalization specifying number of repeating digits\n* [Absolute value](https://en.wikipedia.org/wiki/Absolute_value), visualized as $|a|$\n* [Sign function](https://en.wikipedia.org/wiki/Sign_function)\n* [Square root](https://en.wikipedia.org/wiki/Square_root), visualized as $\\sqrt a$\n* [Factorial](https://en.wikipedia.org/wiki/Factorial), visualized as $n!$\n* Rounding decimal and rational numbers to integers\n     * Truncation\n     * Floor, visualized as $\\lfloor x \\rfloor$\n     * Ceiling, visualized as $\\lceil x \\rceil$\n     * Any other rounding mode\n* Rounding decimal and rational numbers to decimal with decimal places\n* Rounding decimal and rational numbers to multiple values\n* Separation of integer and decimal parts, retrieving the number of decimal places\n* List of digits of a integer positive number\n     * In base 10 by default, but any integer positive number can be specified as the base\n     * A size (of list) can be specified. For numbers with less digits, zero values are padded\n* [Pseudorandom number](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) generation with uniform distribution\n   * In the real interval $\\[ 0, 1 \\rangle$\n   * In a range of integer values\n* Testing operation\n     * Expression being a real number (integer or decimal)\n     * Expression being a rational number\n     * Expression being numeric (a integer, decimal or rational number)\n     * Expression beig an integer number (an integer, or decimal number with no fractional part)\n     * Expression being an integer number\n     * Expression being a decimal number\n     * Expression beign a positive number, either integer, decimal or rational\n     * Expression beign a negative number, either integer, decimal or rational\n     * Expression being a zero number, either integer or decimal\n     * Expression being an even number (either integer or decimal with no fractional part)\n     * Expression being an odd number (either integer or decimal with no fractional part)\n     * Whether an integer number [divides](https://en.wikipedia.org/wiki/Divisor#Definition) other, visualization as $a \\mid b$\n     * Whether an integer number does not [divide](https://en.wikipedia.org/wiki/Divisor#Definition) other, visualization as $a \\nmid b$\n* Conversion from/to other data types\n   * From string to integer or decimal values, in decimal or bases between 2 and 36\n   * From integer or decimal number to a string representation\n* Div, Mod and DivMod operations\n   * Between integer, decimal and rational number, even mixing them\n   * Using any precision\n   * Using any of the 9 roundig modes, or the [euclidean division](https://en.wikipedia.org/wiki/Euclidean_division) mode\n* Related to [number theory](https://en.wikipedia.org/wiki/Number_theory)\n   * [Primality test](https://en.wikipedia.org/wiki/Primality_test) of a positive integer number\n   * List of [prime factors](https://en.wikipedia.org/wiki/Integer_factorization) of a integer number\n   * [Greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) of a list of integer numbers\n   * [Least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple) of a list of integer numbers\n   * [Modular exponentiation](https://en.wikipedia.org/wiki/Modular_exponentiation)\n   * [Modular multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse)\n* [Piecewise-defined functions](https://en.wikipedia.org/wiki/Piecewise)\n* [Summation of a sequence](https://en.wikipedia.org/wiki/Summation) of a finite number of terms, visually using the [Capital-sigma notation](https://en.wikipedia.org/wiki/Iterated_binary_operation#Notation) $\\sum$\n* [Product of a sequence](https://en.wikipedia.org/wiki/Multiplication#Product_of_a_sequence) of a finite number of terms, visually using the [Capital-pi notation](https://en.wikipedia.org/wiki/Iterated_binary_operation#Notation) $\\prod$\n* Numerical calculation of the following [transcendental functions](https://en.wikipedia.org/wiki/Transcendental_function), for a decimal number, with any precision and rounding mode\n  * [Common (base 10) logarithm](https://en.wikipedia.org/wiki/Common_logarithm)\n  * [Natural logarithm](https://en.wikipedia.org/wiki/Natural_logarithm)\n  * [Binary logarithm](https://en.wikipedia.org/wiki/Binary_logarithm)\n  * [Logarithm in specific base](https://en.wikipedia.org/wiki/Logarithm)\n* Numerical calculation of the following [trigonometric functions](https://en.wikipedia.org/wiki/Trigonometric_functions), for a decimal number, with any precision and rounding mode\n  * Sine, cosine, tangent, cotangent, secant, cosecant\n  * Arc sine, arc cosine, arc tangent, arc cotangent, arc secant, arc cosecant\n  * [2-argument arctangent](https://en.wikipedia.org/wiki/Atan2) (atan2)\n* Numerical calculation of the following [hyperbolic functions](https://en.wikipedia.org/wiki/Hyperbolic_functions), for a decimal number, with any precision and rounding mode\n  * Sine, cosine, tangent, cotangent, secant, cosecant\n  * Arc sine, arc cosine, arc tangent, arc cotangent, arc secant, arc cosecant\n* Symbolic representation of π and e constants. Numeric conversion with any precision and roundig mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulae-org%2Fpackage-arithmetic-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformulae-org%2Fpackage-arithmetic-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulae-org%2Fpackage-arithmetic-js/lists"}