Coder Social home page Coder Social logo

euler's Introduction

Euler

Build Status License Swift Version

Euler uses custom operators in the "Math Symbols" character set to implement functions using traditional mathematical notation.

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.

Euler is much better-suited to a Playground, where it could be used for teaching and learning logic and mathematics using a more vernacular notation.

Euler is named after Leonhard Euler, the Swiss mathematician credited for the popularization of modern mathematical notation such as the Greek letters Σ for summation & π for the ratio of a circle's circumference to its diameter, the letters e to denote the base of the natural logarithm & i to denote the imaginary unit, sin & cos for trigonometric functions, and f(x) to denote the function f with argument x.


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)

euler's People

Contributors

donald-pinckney avatar mattt avatar minsone avatar otaviocc avatar supermarin avatar tammofreese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

euler's Issues

`SignedInteger & UnsignedInteger` is probably the wrong bounds

What I assume was meant was one of (the non-existent) P | Q, duplicating the functions for SignedInteger and UnsignedInteger separately, or use BinaryInteger.

This is because no type does, should, or is semantically permitted to conform to both SignedInteger & UnsignedInteger.

Error in doc

Support for math symbols is documented for Swift.

Swift 3 compatibility

Hey, I'd love to see this lib available in Swift 3 so I can implement it in my project.

Thanks 😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.