Giter Club home page Giter Club logo

decfp.jl's Introduction

DecFP: IEEE Decimal Floating-point in Julia

Build Status Build status Coverage Status

The DecFP package is a Julia wrapper around the Intel Decimal Floating-Point Math Library, providing a software implementation of the IEEE 754-2008 Decimal Floating-Point Arithmetic specification.

32-bit, 64-bit, and 128-bit decimal floating-point types Dec32, Dec64, and Dec128, respectively, are provided. This is very different from packages such as Decimals.jl, which provide arbitrary-precision decimal types analogous to BigFloat: arbitrary precision types are very flexible, but fixed-precision types such as those in DecFP are much faster (though still about 100x slower than the hardware binary floating-point types Float32 and Float64).

The DecFP package currently requires the Julia 0.5 release or later.

Usage

Dec64 and the other types mentioned above can be constructed from other Julia numeric types (binary floating-point or integers) via Dec64(3.5) or Dec(3), from strings by parse(Dec64, "3.2") or d64"3.2" (a Julia string macro); similarly for Dec32 and Dec128. The string macro d"3.2" constructs Dec64.

Once a decimal float is constructed, most Julia arithemetic and special functions should work without modification. For example, d"3.2" * d"4.5" produces the Dec64 result +1440E-2 (14.4). Most basic arithmetic functions are supported, and many special functions (sqrt, log, trigonometric functions, etc.). Mixed operations involving decimal and binary floating-point or integer types are supported (the result is promoted to decimal floating-point).

In general, you should be able to use the DecFP types in any context where you would have used binary floating-point types: arrays, complex arithmetic, and linear algebra should all work, for the most part.

decfp.jl's People

Contributors

stevengj avatar quinnj avatar abhijithch avatar ranjanan avatar staticfloat avatar hyiltiz avatar pallharaldsson avatar scottpjones avatar nkottary avatar

Watchers

Nicolas Payette 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.