GithubHelp home page GithubHelp logo

tyabu12 / ocaml-round Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 20 KB

A floating-point rounding control library for OCaml.

Home Page: https://tyabu.hatenablog.jp/entry/ocaml-round

License: Apache License 2.0

C 65.18% OCaml 28.57% Makefile 6.25%
ocaml rounding floating-point ieee754

ocaml-round's Introduction

round

Build Status

round is a floating-point rounding control library for OCaml.

round provides functions about floating-point with specified rounding directions.

round follows IEE-754 that defines rounding behaviors about basic operators and sqrt functions.

Requirements

  • GNU make
  • OCaml (>= 4.02)
  • dune (>= 1.2)

Installation

Using opam

opam pin add -y round [email protected]:tyabu12/ocaml-round.git

From sources

make
make install

Test

You can confirm behavior of floating-point rounding direction:

$ make test
x = 1.000000e+00, y = 1.000000e-40, z = -1.000000e-40
round NearestTiesToEven:
  x + y = 1.000000000000000000e+00
  x + z = 1.000000000000000000e+00
round ToZero:
  x + y = 1.000000000000000000e+00
  x + z = 9.999999999999998890e-01
round Up:
  x + y = 1.000000000000000222e+00
  x + z = 1.000000000000000000e+00
round Down:
  x + y = 1.000000000000000000e+00
  x + z = 9.999999999999998890e-01
...

Documentation

To generate docs, odoc is required.

make doc

The generated docs can then be found locally at _build/default/_doc/_html/index.html.

License

See LICENSE.

ocaml-round's People

Contributors

tyabu12 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

brgr

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.