{"id":29127910,"url":"https://github.com/akhilakkapelli/highprecisionarithmetic.jl","last_synced_at":"2025-06-30T01:02:09.175Z","repository":{"id":298000125,"uuid":"998424191","full_name":"AkhilAkkapelli/HighPrecisionArithmetic.jl","owner":"AkhilAkkapelli","description":"Julia library for precise, efficient, and scalable linear algebra using high-precision arithmetic","archived":false,"fork":false,"pushed_at":"2025-06-18T13:44:20.000Z","size":982,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-18T14:32:19.782Z","etag":null,"topics":["arbitrary-precision-arithmetic","high-performance-computing","high-precision","julia","large-matrices","linear-algebra","linear-programming"],"latest_commit_sha":null,"homepage":"https://akhilakkapelli.github.io/HighPrecisionArithmetic.jl","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AkhilAkkapelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-06-08T15:26:32.000Z","updated_at":"2025-06-18T13:43:35.000Z","dependencies_parsed_at":"2025-06-08T21:38:42.770Z","dependency_job_id":null,"html_url":"https://github.com/AkhilAkkapelli/HighPrecisionArithmetic.jl","commit_stats":null,"previous_names":["akhilakkapelli/highprecisionarithmetic.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AkhilAkkapelli/HighPrecisionArithmetic.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkhilAkkapelli%2FHighPrecisionArithmetic.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkhilAkkapelli%2FHighPrecisionArithmetic.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkhilAkkapelli%2FHighPrecisionArithmetic.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkhilAkkapelli%2FHighPrecisionArithmetic.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkhilAkkapelli","download_url":"https://codeload.github.com/AkhilAkkapelli/HighPrecisionArithmetic.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkhilAkkapelli%2FHighPrecisionArithmetic.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262690426,"owners_count":23349168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","high-performance-computing","high-precision","julia","large-matrices","linear-algebra","linear-programming"],"created_at":"2025-06-30T01:02:06.332Z","updated_at":"2025-06-30T01:02:09.111Z","avatar_url":"https://github.com/AkhilAkkapelli.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ctable style=\"width: 100%; border-collapse: collapse; margin: 0 auto; padding: 0;\"\u003e\n  \u003ctr\u003e\n    \u003c!-- Logo Cell --\u003e\n    \u003ctd style=\"width: 100px; padding: 0px; vertical-align: middle; text-align: center;\"\u003e\n      \u003ca href=\"https://akhilakkapelli.github.io/HighPrecisionArithmetic.jl\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/AkhilAkkapelli/HighPrecisionArithmetic.jl/master/docs/src/assets/logo.svg\"\n             alt=\"High Precision Arithmetic Docs Logo\"\n             style=\"max-width: 100px; height: auto; display: block; margin: 0 auto;\"\n             onerror=\"this.onerror=null;this.src='https://placehold.co/100x100?text=Logo';\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003c!-- Text Cell --\u003e\n    \u003ctd style=\"padding-left: 0px; padding-right: 0px; vertical-align: middle; text-align: left;\"\u003e\n      \u003ch2 style=\"font-size: 1.rem; font-weight: bold; margin: 0; line-height: 1.3;\"\u003e\n      Julia library for precise, efficient, and scalable linear algebra using high-precision arithmetic\n      \u003c/h2\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n# High Precision Arithmetic in Julia\n\nThis Julia library provides custom types and operations for performing high-precision arithmetic and linear algebra. It's designed for scenarios where standard floating-point or fixed-size integer types might not offer sufficient precision for very large numbers or complex computations.\n\n## Features\n\nThis library is composed of two main modules:\n\n1. `HighPrecisionArithmetic`\n   - **Arbitrary Precision Integers**: Defines `HighPrecisionInt` to handle integers of virtually any size, limited only by available memory.\n   - **Core Arithmetic Operations**: Overloads standard arithmetic operators (`+`, `-`, `*`) for `HighPrecisionInt` objects, ensuring precision is maintained across operations.\n   - **Conversions**: Seamlessly convert between Julia's `BigInt` and `HighPrecisionInt`.\n2. `HighPrecisionLinearAlgebra`\n   - **High Precision Vectors**: Introduces HighPrecisionVector for vectors whose elements are HighPrecisionInts.\n   - **High Precision Matrices**: Introduces `HighPrecisionMatrix` for matrices composed of `HighPrecisionInt` elements.\n   - **Vector Operations**: Supports vector addition (`+`), subtraction (`-`), scalar multiplication (`*`), and dot product (`LinearAlgebra.dot`).\n   - **Matrix Operations**: Supports matrix addition (`+`), subtraction (`-`), scalar multiplication (`*`), matrix-vector multiplication (`*`), and matrix-matrix multiplication (`*`).\n   - **Optimized Inner Loops**: For performance-critical matrix and vector multiplications, intermediate products and sums are computed using Julia's native `BigInt` for efficiency, then converted back to `HighPrecisionInt` for the final result.\n  \n  ## Getting Started\n  \n  To use this library, you'll need to have Julia installed.\n  \n  ### Installation\n  \n  Since this is a local library (not a registered package), you'll need to place the module files directly into your project directory or a location Julia can access.\n  \n  1. Save the code for the `HighPrecisionArithmetic` module into a file named `HighPrecisionArithmetic.jl`.\n  \n  2. Save the code for the `HighPrecisionLinearAlgebra` module into a file named `HighPrecisionLinearAlgebra.jl` in the same directory as `HighPrecisionArithmetic.jl`. \n\n### Usage\n    \nYou can load and use the modules in your Julia script or REPL:\n\n```julia\n# 1. Include the HighPrecisionArithmetic module\ninclude(\"HighPrecisionArithmetic.jl\")\n\n# 2. Include and use the HighPrecisionLinearAlgebra module\n#    (which also brings HighPrecisionArithmetic into scope implicitly for its types)\ninclude(\"HighPrecisionLinearAlgebra.jl\")\nusing .HighPrecisionLinearAlgebra\nusing .HighPrecisionArithmetic # Optional: use if you directly instantiate HighPrecisionInt often\n```\n\n## Examples\n\nHere are some quick examples to get you started:\n\n### High Precision Integers\n\n```julia\nusing .HighPrecisionArithmetic\n\n# Create HighPrecisionInt\na = HighPrecisionInt(12345678901234567890)\nb = HighPrecisionInt(9876543210987654321)\n\n# Addition\nsum_val = a + b\nprintln(\"Sum: $sum_val\")\n\n# Multiplication\nprod_val = a * b\nprintln(\"Product: $prod_val\")\n\n# Convert to BigInt for verification\nprintln(\"Sum as BigInt: $(BigInt(sum_val))\")\n```\n\n### High Precision Vectors and Matrices\n\n```julia\nusing .HighPrecisionLinearAlgebra\nusing .HighPrecisionArithmetic # Ensure HighPrecisionInt is directly accessible\n\n# Create HighPrecisionVectors\nvec_a = HighPrecisionVector([10, -20, 30])\nvec_b = HighPrecisionVector([5, 15, -25])\n\n# Vector Addition\nvec_sum = vec_a + vec_b\nprintln(\"\\nVector Sum: $vec_sum\")\n\n# Dot Product (leveraging BigInt for intermediate precision)\ndot_prod = LinearAlgebra.dot(vec_a, vec_b)\nprintln(\"Dot Product: $dot_prod\")\n\n# Create HighPrecisionMatrices\nmat1 = HighPrecisionMatrix([[1, 2], [3, 4]])\nmat2 = HighPrecisionMatrix([[5, 6], [7, 8]])\n\n# Matrix Multiplication (leveraging BigInt for intermediate precision)\nmat_prod = mat1 * mat2\nprintln(\"\\nMatrix Product:\\n$mat_prod\")\n\n# Matrix-Vector Multiplication (compatible dimensions)\nvec_c = HighPrecisionVector([HighPrecisionInt(1), HighPrecisionInt(2)]) # Needs to match mat1 columns\nmat_vec_prod = mat1 * vec_c\nprintln(\"\\nMatrix-Vector Product:\\n$mat_vec_prod\")\n```\n\n## Structure\n\nThe library is organized into two primary Julia modules:\n\n- `HighPrecisionArithmetic.jl`: Contains the fundamental `HighPrecisionInt` type and its core arithmetic operations (`+`, `-`, `*`, `abs`, comparisons). This forms the base for all high-precision numerical work.\n\n- `HighPrecisionLinearAlgebra.jl`: Builds upon `HighPrecisionArithmetic`. It defines `HighPrecisionVector` and `HighPrecisionMatrix` and overloads linear algebra operations (addition, subtraction, scalar multiplication, dot product, matrix-vector, and matrix-matrix multiplication) to work with these high-precision types. It intelligently uses `BigInt` internally for efficient accumulation during multiplications to maintain full precision.\n  \n## License\n\nThis project is made available under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhilakkapelli%2Fhighprecisionarithmetic.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhilakkapelli%2Fhighprecisionarithmetic.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhilakkapelli%2Fhighprecisionarithmetic.jl/lists"}