{"id":21585363,"url":"https://github.com/objecthub/swift-numberkit","last_synced_at":"2025-04-10T20:06:28.909Z","repository":{"id":36264099,"uuid":"40568540","full_name":"objecthub/swift-numberkit","owner":"objecthub","description":"Advanced numeric data types for Swift 5, including BigInt, Rational, and Complex numbers.","archived":false,"fork":false,"pushed_at":"2024-04-12T21:19:45.000Z","size":916,"stargazers_count":53,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T03:04:25.164Z","etag":null,"topics":["arbitrary-precision-integers","bigint","biginteger","complex-numbers","numbers","numeric-types","rational-numbers","swift","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/objecthub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-08-11T22:36:28.000Z","updated_at":"2024-04-17T17:35:43.411Z","dependencies_parsed_at":"2024-04-17T17:35:42.499Z","dependency_job_id":"44ea495b-6e80-45e3-829a-2123907cde80","html_url":"https://github.com/objecthub/swift-numberkit","commit_stats":{"total_commits":101,"total_committers":6,"mean_commits":"16.833333333333332","dds":0.05940594059405946,"last_synced_commit":"5eff8df2428873d06bfa06dbcc53a4ab1a8be9b4"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objecthub%2Fswift-numberkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objecthub%2Fswift-numberkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objecthub%2Fswift-numberkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objecthub%2Fswift-numberkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objecthub","download_url":"https://codeload.github.com/objecthub/swift-numberkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288340,"owners_count":21078900,"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-integers","bigint","biginteger","complex-numbers","numbers","numeric-types","rational-numbers","swift","swift-library"],"created_at":"2024-11-24T15:10:23.166Z","updated_at":"2025-04-10T20:06:28.865Z","avatar_url":"https://github.com/objecthub.png","language":"Swift","readme":"# Swift NumberKit\n\n[![Platforms: macOS, iOS, Linux](https://img.shields.io/badge/Platforms-macOS,%20iOS,%20Linux-blue.svg?style=flat)](https://developer.apple.com/osx/) [![Language: Swift 5/6](https://img.shields.io/badge/Language-Swift%206-green.svg?style=flat)](https://developer.apple.com/swift/) [![IDE: Xcode 15/16](https://img.shields.io/badge/IDE-Xcode%2016-orange.svg?style=flat)](https://developer.apple.com/xcode/) [![Package managers: SwiftPM, Carthage](https://img.shields.io/badge/Package%20managers-SwiftPM,%20Carthage-8E64B0.svg?style=flat)](https://github.com/Carthage/Carthage) [![License: Apache](http://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat)](https://raw.githubusercontent.com/objecthub/swift-numberkit/master/LICENSE)\n\n## Overview\n\nThis is a framework implementing advanced numeric data types for the Swift programming\nlanguage on macOS, iOS and Linux. Currently, the framework provides four new numeric types,\neach represented as a struct or enumeration:\n\n  1. `BigInt`: arbitrary-size signed integers\n  2. `Integer`: arbitrary-size signed integers whose implementation depends on the size\n      of the represented value.\n  2. `Rational`: signed rational numbers\n  3. `Complex`: complex floating-point numbers\n\n**Note**: So far, with every major version of Swift, Apple decided to change the foundational APIs of the numeric\ntypes in Swift significantly and consistently in a backward incompatible way. In order to be more isolated from\nsuch changes in future, with Swift 3, I decided to introduce a distinct integer type used in NumberKit based on a\nnew protocol `IntegerNumber`. All standard numeric integer types implement this protocol. This is now consistent\nwith the usage of protocol `FloatingPointNumber` for floating point numbers, where there was, so far, never a\nreal, generic enough foundation (and still isn't).\n\n## BigInt\n\n`BigInt` values are immutable, signed, arbitrary-size integers that can be used as a\ndrop-in replacement for the existing binary integer types of Swift 5.\n[Struct `BigInt`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/BigInt.swift) defines all\nthe standard arithmetic integer operations and implements the corresponding numeric\nprotocols of Swift.\n\n## Integer\n\n`Integer` values are immutable, signed, arbitrary-size integers that can be used as a\ndrop-in replacement for the existing binary integer types of Swift 5. As opposed to `BigInt`,\nthe representation of values is chosen to optimize for memory size and performance of\narithmetic operations. [Enum `Integer`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Integer.swift)\ndefines all the standard arithmetic integer operations and implements the corresponding\nnumeric protocols of Swift.\n\n## Rational\n\n[Struct `Rational\u003cT\u003e`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Rational.swift)\ndefines immutable, rational numbers based on an existing signed integer\ntype `T`, like `Int32`, `Int64`, or `BigInt`. A rational number is a signed number that can\nbe expressed as the quotient of two integers _a_ and _b_: _a / b_.\n\n## Complex\n\n[Struct `Complex\u003cT\u003e`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Complex.swift)\ndefines complex numbers based on an existing floating point type `T`, like `Float` or `Double`. A complex number\nconsists of two components, a real part _re_ and an imaginary part _im_ and is typically written as: _re + im * i_\nwhere _i_ is the _imaginary unit_.\n\n## Requirements\n\nThe following technologies are needed to build the components of the _Swift NumberKit_ framework:\n\n- [Xcode 15 or Xcode 16](https://developer.apple.com/xcode/)\n- [Swift 5 or Swift 6](https://developer.apple.com/swift/)\n- [Swift Package Manager](https://swift.org/package-manager/)\n- macOS, iOS or Linux\n\n## Copyright\n\nAuthor: Matthias Zenger (\u003cmatthias@objecthub.net\u003e)  \nCopyright © 2016-2024 Matthias Zenger. All rights reserved.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjecthub%2Fswift-numberkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjecthub%2Fswift-numberkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjecthub%2Fswift-numberkit/lists"}