{"id":1386,"url":"https://github.com/mattt/Euler","last_synced_at":"2025-08-02T04:30:58.987Z","repository":{"id":19417897,"uuid":"22660233","full_name":"mattt/Euler","owner":"mattt","description":"Swift Custom Operators for Mathematical Notation","archived":true,"fork":false,"pushed_at":"2021-04-20T16:53:44.000Z","size":112,"stargazers_count":1154,"open_issues_count":0,"forks_count":60,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-07-11T02:47:55.168Z","etag":null,"topics":["math","notation","operator","playground","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/mattt.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}},"created_at":"2014-08-05T21:33:35.000Z","updated_at":"2025-05-31T18:27:35.000Z","dependencies_parsed_at":"2022-09-05T16:01:51.315Z","dependency_job_id":null,"html_url":"https://github.com/mattt/Euler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mattt/Euler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FEuler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FEuler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FEuler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FEuler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattt","download_url":"https://codeload.github.com/mattt/Euler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FEuler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334609,"owners_count":24233793,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["math","notation","operator","playground","swift"],"created_at":"2024-01-05T20:15:45.257Z","updated_at":"2025-08-02T04:30:58.724Z","avatar_url":"https://github.com/mattt.png","language":"Swift","readme":"# Euler\n\n[![Build Status][ci status badge]][ci status]\n[![License][license badge]][license]\n[![Swift Version][swift version badge]][swift version]\n\nEuler uses [custom operators in the \"Math Symbols\"](https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID418) character set to implement functions using traditional mathematical notation.\n\n**Please keep in mind that this is not intended or recommended for production.** Custom operators of any breed are ripe for misuse and abuse, and should be used with as much care and caution as you would something like method swizzling or complex macros.\n\nEuler is much better-suited to a Playground, where it could be used for teaching and learning logic and mathematics using a more vernacular notation.\n\n\u003e Euler is named after [Leonhard Euler](http://en.wikipedia.org/wiki/Leonhard_Euler), the Swiss mathematician credited for the popularization of modern mathematical notation such as the Greek letters `Σ` for summation \u0026 `π` for the ratio of a circle's circumference to its diameter, the letters _`e`_ to denote the base of the natural logarithm \u0026 _`i`_ to denote the imaginary unit, `sin` \u0026 `cos` for trigonometric functions, and `f(x)` to denote the function `f` with argument `x`.\n\n---\n\n## Example Usage\n\n```swift\nimport Foundation\nimport Euler\nimport PlaygroundSupport\n\n𝑒 // 2.718281828459045\n\n¬true // false\n\n3 × 4 // 12\n\nlet prime = [2, 3, 5, 7, 11]\nlet fibonacci = [1, 1, 2, 3, 5, 8, 13]\nprime ∩ fibonacci // {2, 3, 5}\n\n∑[1, 2, 3, 4, 5] // 15\n\n[1, 2] ⋅ [3, 4] // 11\n\n7 ≠ 9 // true\n\nvar f: (Double) -\u003e Double = sin\nlet g: (Double) -\u003e Double = cos\n\nfor x in stride(from: 0, to: 4 * π, by: π / 8) {\n    (f ∘ g)(x) // ∿∿∿\n}\n\n(f′)(π) // -1\n```\n\n## Inventory\n\n### Mathematical Constants\n\n- `π` - [Pi](http://en.wikipedia.org/wiki/Pi)\n- `𝝉` - [Tau](http://en.wikipedia.org/wiki/Tau_%282%CF%80%29#tau)\n- `𝑒` - [e](http://en.wikipedia.org/wiki/E_%28mathematical_constant%29)\n- `ε` - [Machine Epsilon](https://en.wikipedia.org/wiki/Machine_epsilon)\n\n### Logic\n\n- `¬`, `~` - [Logical Negation](http://en.wikipedia.org/wiki/Negation)\n- `∧` - [Logical Conjunction](http://en.wikipedia.org/wiki/Logical_conjunction)\n- `∨` - [Logical Disjunction](http://en.wikipedia.org/wiki/Logical_disjunction)\n- `⊻`, `⊕`, `↮`, `≢` - [Logical XOR](http://en.wikipedia.org/wiki/Exclusive_or)\n- `⊼`, `↑` - [Logical NAND](http://en.wikipedia.org/wiki/Logical_NAND)\n- `⊽`, `↓` - [Logical NOR](http://en.wikipedia.org/wiki/Logical_NOR)\n- `⊦` - [Logical Assertion](http://en.wikipedia.org/wiki/Logical_Assertion)\n\n## Arithmetic\n\n- `×` - [Multiplication](http://en.wikipedia.org/wiki/Multiplication)\n- `÷`, `∕` - [Division](http://en.wikipedia.org/wiki/Division_%28mathematics%29)\n- `√` - [Square Root](http://en.wikipedia.org/wiki/Square_root)\n- `∛` - [Cube Root](http://en.wikipedia.org/wiki/Cube_root)\n- `∜` - [Tesseract Root](http://en.wikipedia.org/wiki/Nth_root)\n- `±` - [Plus/Minus](http://en.wikipedia.org/wiki/Plus-minus_sign)\n- `∓` - [Minus/Plus](http://en.wikipedia.org/wiki/Plus-minus_sign#Minus-plus_sign)\n- `∣` - [Divides](http://en.wikipedia.org/wiki/Divisor)\n- `∤` - [Does Not Divide](http://en.wikipedia.org/wiki/Divisor)\n\n## Sets\n\n- `∈` - [Set Membership](http://en.wikipedia.org/wiki/Element_%28mathematics%29)\n- `∉` - [Set Non-Membership](http://en.wikipedia.org/wiki/Element_%28mathematics%29)\n- `∋` - [Converse Set Membership](http://en.wikipedia.org/wiki/Element_%28mathematics%29)\n- `∌` - [Converse Set Membership](http://en.wikipedia.org/wiki/Element_%28mathematics%29)\n- `∩` - [Set Intersection](http://en.wikipedia.org/wiki/Intersection_%28set_theory%29)\n- `∪` - [Set Union](http://en.wikipedia.org/wiki/Union_%28set_theory%29)\n- `⊆` - [Subset](http://en.wikipedia.org/wiki/Subset)\n- `⊂` - [Proper Subset](http://en.wikipedia.org/wiki/Subset)\n- `⊄` - [Not A Subset Of](http://en.wikipedia.org/wiki/Subset)\n- `⊇` - [Superset](http://en.wikipedia.org/wiki/Subset)\n- `⊃` - [Proper Superset](http://en.wikipedia.org/wiki/Subset)\n- `⊅` - [Not A Superset Of](http://en.wikipedia.org/wiki/Subset)\n\n## Sequences\n\n- `∑` - [Summation](http://en.wikipedia.org/wiki/Summation)\n- `∏` - [Cartesian Product](http://en.wikipedia.org/wiki/Cartesian_product)\n\n## Vectors\n\n- `⋅` - [Dot Product](http://en.wikipedia.org/wiki/Dot_product)\n- `×` - [Cross Product](http://en.wikipedia.org/wiki/Cross_product)\n- `‖` - [Vector Norm](http://en.wikipedia.org/wiki/Norm_%28mathematics%29)\n- `⦡` - [Angle Between Vectors](http://en.wikipedia.org/wiki/Dot_product)\n\n## Comparison\n\n- `⩵` - [Equality](http://en.wikipedia.org/wiki/Equality_%28mathematics%29)\n- `≠` - [Inequality](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≤` - [Less Than Or Equal To](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≨` - [Less Than And Not Equal To](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≥` - [Greater Than Or Equal To](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≩` - [Greater Than And Not Equal To](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≬` - [Between](http://en.wikipedia.org/wiki/Inequality_%28mathematics%29)\n- `≈` - [Approximate Equality](http://en.wikipedia.org/wiki/Approximation)\n- `≉` - [Approximate Inequality](http://en.wikipedia.org/wiki/Approximation)\n\n## Calculus\n\n- `′` - [Derivative](http://en.wikipedia.org/wiki/Derivative#Lagrange.27s_notation)\n- `∫` - [Integral](http://en.wikipedia.org/wiki/Integral)\n\n## Functions\n\n- `∘` - [Composition](http://en.wikipedia.org/wiki/Function_composition)\n\n---\n\n## License\n\nMIT\n\n## Contact\n\nMattt ([@mattt](https://twitter.com/mattt))\n\n[ci status]: https://github.com/mattt/Euler/actions\n[ci status badge]: https://github.com/mattt/Euler/workflows/CI/badge.svg\n[license]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[swift version]: https://swift.org/download/\n[swift version badge]: http://img.shields.io/badge/swift%20version-5.0-orange.svg?style=flat\n","funding_links":[],"categories":["Math","Swift","Extensions"],"sub_categories":["Other Hardware","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FEuler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattt%2FEuler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FEuler/lists"}