Coder Social home page Coder Social logo

holdenk / picomath Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghewgill/picomath

1.0 3.0 0.0 1.04 MB

Stand-alone numeric code snippets

Home Page: http://picomath.org

C++ 6.27% C 0.09% C# 6.60% D 3.43% Erlang 5.87% Python 10.26% Go 3.54% Haskell 6.62% Java 6.71% JavaScript 5.62% Lua 5.33% Pascal 5.53% Perl 5.54% PHP 5.49% Ruby 5.25% Scala 5.61% Scheme 6.62% Tcl 5.65%

picomath's Introduction

picomath

Picomath is a collection of small math functions inspired by John D. Cook's Stand-alone code for numerical computing. It is not compiled into a library in the usual sense (that is, something you can link to). Rather, the functions are presented as standalone snippets of code.

License

The picomath library is in the public domain. Do whatever you want with it, no strings attached. Use at your own risk.

Features

Picomath provides the following functions:

Languages

The functions are implemented in the following languages:

Usage

The picomath library is organised into subdirectories, with each language in a subdirectory. Each function (or group of interrelated functions such as Gamma and Log Gamma) are implemented in one source file. Each source file is designed with minimal dependencies, so it can be included directly into a project as is, or copy and pasted into other code.

Test Suite

The test suite consists of two parts:

  • an SConstruct file (for SCons, a command line build system) to build the test code as needed
  • a Python test.py driver at the top level, and a corresponding test.* for each language

To build the tests:

$ scons

To run the tests:

$ python test.py

The expected output is:

Checking ada... ok
Checking cpp... ok
Checking csharp... ok
Checking d... ok
Checking erlang... ok
Checking go... ok
Checking haskell... ok
Checking java... ok
Checking javascript... ok
Checking lua... ok
Checking pascal... ok
Checking perl... ok
Checking php... ok
Checking python... ok
Checking ruby... ok
Checking scheme... ok
Checking tcl... ok

The top level test.py runs each language-specific test.* in turn, communicating with the implementation using standard input and output. A simple text-based protocol is used to execute functions and return results.

About

  • John D. Cook is the original author of most of the functions themselves.
  • Greg Hewgill implemented the test framework and translated the functions to many of the included languages.

picomath's People

Contributors

ghewgill avatar holdenk avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

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.