MyGrokOrg

Base256

Repository

IEEE 754 · binary256

Octuple precision.237-bit significand, C++23.

Header-only library with correctly-rounded add, subtract, multiply, divide, FMA and square root. This page runs the same format in the browser so you can inspect bits, compare with binary64, and confirm that 1 + 2−80 is not 1.

Sign
1 bit
Exponent
19 bits
Fraction
236 bits
Decimal digits
~71

Workbench

Evaluate binary256 expressions. Operands accept decimal, hex-float (0x1.p+0), inf, nan.

resultnormal

1.00000000000000000000000e+0

0x1.00000000000000000001000000000000000000000000000000000000000p+0

word 0 · LSB

0000000000000000

word 1

0000000000000000

word 2

0000000010000000

word 3 · MSB

3ffff00000000000

Register

256-bit encoding: sign · 19-bit exponent · 236-bit trailing significand. Little-endian words below.

sign 1exponent 19fraction 236

0011111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Precision lab

Cases binary64 cannot represent. binary256 keeps them.

Casebinary64binary256
1 + 2⁻⁸⁰ == 1truefalse
(1/3) × 3 == 1truetrue
| (0.1+0.2) − 0.3 |5.551e-172.2639198e-72

C++23

Header-only. Clone, include, compile with -std=c++23.

#include <base256/base256.hpp>
using namespace base256::literals;

auto one   = float256::one();
auto delta = ldexp(one, -80);
auto sum   = one + delta;          // 1 + 2^-80, exact
assert(sum != one);

auto third = 1.0_f256 / 3.0_f256;
assert(third * 3.0_f256 == one);
github.com/MyGrokOrg/Base256_GrokBuild_4_6b

Self-check

The in-browser port of the same IEEE 754 packing and arithmetic.