All Projects → JuliaMath → DecFP.jl

JuliaMath / DecFP.jl

Licence: other
Julia IEEE decimal floating-point via the Intel decimal-float library

Programming Languages

julia
2034 projects
Jsonnet
166 projects

Projects that are alternatives of or similar to DecFP.jl

cldr-engine
Internationalization and localization in Typescript with Unicode CLDR, batteries included
Stars: ✭ 34 (-30.61%)
Mutual labels:  math, decimal
decimal
An arbitrary-precision decimal floating-point arithmetic package for Go
Stars: ✭ 28 (-42.86%)
Mutual labels:  decimal, floating-point
DoubleFloats.jl
math with more good bits
Stars: ✭ 102 (+108.16%)
Mutual labels:  math, floating-point
decimal-eval
A tiny, safe, fast JavaScript library for decimal arithmetic expressions.
Stars: ✭ 18 (-63.27%)
Mutual labels:  math, decimal
ChangePrecision.jl
macro to change the default floating-point precision in Julia code
Stars: ✭ 28 (-42.86%)
Mutual labels:  math, floating-point
Julia Set Playground
A Swift playground that generates beautiful Julia set fractal images.
Stars: ✭ 236 (+381.63%)
Mutual labels:  math
tacent
A C++ library implementing linear algebra, text and file IO, UTF-N conversions, containers, image loading/saving, image quantization/filtering, command-line parsing, etc.
Stars: ✭ 43 (-12.24%)
Mutual labels:  math
Simple Statistics
simple statistics for node & browser javascript
Stars: ✭ 2,679 (+5367.35%)
Mutual labels:  math
Math Science Video Lectures
List of Science courses with video lectures
Stars: ✭ 219 (+346.94%)
Mutual labels:  math
nim-mathexpr
Tiny math expression evaluator library implemented in pure Nim
Stars: ✭ 58 (+18.37%)
Mutual labels:  math
verrou
floating-point errors checker
Stars: ✭ 39 (-20.41%)
Mutual labels:  floating-point
Gcem
A C++ compile-time math library using generalized constant expressions
Stars: ✭ 252 (+414.29%)
Mutual labels:  math
Xaos
Real-time interactive fractal zoomer
Stars: ✭ 239 (+387.76%)
Mutual labels:  math
cpc
Text calculator with support for units and conversion
Stars: ✭ 89 (+81.63%)
Mutual labels:  math
Upmath.me
Markdown and LaTeX online editor - create text for web with equations and diagrams
Stars: ✭ 234 (+377.55%)
Mutual labels:  math
kalker
Kalker/kalk is a calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
Stars: ✭ 1,237 (+2424.49%)
Mutual labels:  math
Stdlib
✨ Standard library for JavaScript and Node.js. ✨
Stars: ✭ 2,749 (+5510.2%)
Mutual labels:  math
Polyhedra Viewer
Explore the relationships between convex regular-faced polyhedra.
Stars: ✭ 253 (+416.33%)
Mutual labels:  math
livebook
Automate code & data workflows with interactive Elixir notebooks
Stars: ✭ 3,402 (+6842.86%)
Mutual labels:  math
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+406.12%)
Mutual labels:  math

DecFP: IEEE Decimal Floating-point in Julia

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 50x slower than the hardware binary floating-point types Float32 and Float64) and more memory-efficient (an array of Dec64 values has exactly the same memory footprint as an array of Float64 values).

The latest version of the DecFP package requires Julia 1.3 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.

  • Note: A decimal floating-point constant like 1.1 in Julia refers to a Float64 (binary floating-point) value. So, for example, Dec128(1.999999999999999999) == 2.0 ≠ d128"1.999999999999999999", since Julia first rounds 1.999999999999999999 to the closest Float64 value (2.0) before converting to Dec128. If you need to specify an exact decimal constant, therefore, use one of the string-based constructors. If you use a string macro like d128"1.999999999999999999", then the string parsing occurs before compilation and incurs no runtime cost.

Once a decimal float is constructed, most Julia arithmetic and special functions should work without modification. For example, d"3.2" * d"4.5" produces the (exact) Dec64 result 14.4 All 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].