Contents

mattt/euler

Euler 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.

Example Usage

import Foundation
import Euler
import PlaygroundSupport

𝑒 // 2.718281828459045

¬true // false

3 × 4 // 12

let prime = [2, 3, 5, 7, 11]
let fibonacci = [1, 1, 2, 3, 5, 8, 13]
prime  fibonacci // {2, 3, 5}

[1, 2, 3, 4, 5] // 15

[1, 2]  [3, 4] // 11

7 9 // true

var f: (Double) -> Double = sin
let g: (Double) -> Double = cos

for x in stride(from: 0, to: 4 * π, by: π / 8) {
    (f  g)(x) // ∿∿∿
}

(f)(π) // -1

Inventory

Mathematical Constants

Logic

Arithmetic

Sets

Sequences

Vectors

Comparison

Calculus

Functions


License

MIT

Contact

Mattt (@mattt)

[ci status]: https://github.com/mattt/Euler/actions [ci status badge]: https://github.com/mattt/Euler/workflows/CI/badge.svg [license]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat [license badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat [swift version]: https://swift.org/download/ [swift version badge]: http://img.shields.io/badge/swift%20version-5.0-orange.svg?style=flat

Package Metadata

Repository: mattt/euler

Default branch: master

README: README.md