NUTS - Numerical Tools - is a library of fixed size numbers written for the 64-bit Free Pascal compiler (version 3.0.0 or higher).

Currently the library contains only 128-bit floating-point numbers (also named Quadruple) with the basic operations QAdd, QSub, QMul, QDiv, QRem, QSqrt, and QFMA.
There are no transcendental functions yet.

Does this library follow some "754-xxxx" standard?
Clearly, no. There are no so-called signaling NaNs. All NaNs are regarded as quiet NaNs.
Any other difference, except the number of implemented functions, with the "754-2008" standard would be a bug since it would not be intentional.

The current version is an alpha version. Many things can still be modified. There is no documentation yet but the code is commented and there is a Lazarus demo project: nuts.Demo.Float128s.

NUTS was tested with x86_64 processors only.
NUTS cannot run on big endian systems. Adapting the Pascal code should not be too difficult but I have no big endian machine in order to check the code.
Though it would not be intentional, it is possible that NUTS does not work with an other OS than Linux.

Examples of use

Here are examples of use of the project nuts.Demo.Float128s for Lazarus.


v0.1.3 - alpha  (March 11, 2022)
• File demos/nuts. demos.float128s.main.pas
◦ Modified the Demo340 method (QDiv).

• File units/nuts. float128s.pas
◦ Fixed a very stupid bug in the QEqual() and QEqualAbs() functions.
◦ Minor internal improvements.

 Previous changes


The NUTS Library is free software; you can redistribute it and/or modify it under the terms of the 3-Clause BSD License.

Pascal source for the 64-bit Free Pascal compiler 3.0.0 or higher:
 nuts-   (116 kB)