CopperFloat 0.1.0-preview.1

This is a prerelease version of CopperFloat.
dotnet add package CopperFloat --version 0.1.0-preview.1
                    
NuGet\Install-Package CopperFloat -Version 0.1.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CopperFloat" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CopperFloat" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="CopperFloat" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CopperFloat --version 0.1.0-preview.1
                    
#r "nuget: CopperFloat, 0.1.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CopperFloat@0.1.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CopperFloat&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CopperFloat&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

CopperFloat

CopperFloat provides deterministic, allocation-free extended 80-bit floating-point arithmetic for .NET. Values retain their complete 80-bit encoding, including NaN payloads and noncanonical encodings, while arithmetic uses an explicit rounding context and returns IEEE exception flags with each result.

The first public preview targets net10.0:

dotnet add package CopperFloat --version 0.1.0-preview.1

The architectural arithmetic and final rounding decisions use managed integer arithmetic. A few common binary32/binary64 operations may use hardware instructions only behind exactness checks; host rounding state never determines the result. The package has no runtime dependencies.

Accuracy and scope

CopperFloat preserves raw extF80 encodings and models zero, subnormal, normal, infinity, quiet/signaling NaN, and unsupported values. Arithmetic supports explicit 24-, 53-, and 64-bit precision, four rounding modes, tininess selection, and exception flags. It does not provide a process-global floating-point environment, trap delivery, Motorola FPSR/FPCR policy, or a memory layout for 12-byte Motorola extended slots; those belong in the CPU integration layer.

The committed CopperFloat test fixtures are generated from Berkeley TestFloat 3e. The external level-2 oracle is optional and uses an independently installed TestFloat/SoftFloat toolchain; neither is distributed in the package.

Representation

using CopperFloat;

var one = ExtF80.FromBits(0x3fff, 0x8000_0000_0000_0000);
Span<byte> encoded = stackalloc byte[ExtF80.EncodedSize];
one.WriteBigEndian(encoded);

ExtF80 deliberately has no public in-memory layout contract. Use FromBits, ReadBigEndian, ReadLittleEndian, WriteBigEndian, or WriteLittleEndian when interchanging raw values.

Arithmetic

var context = ExtF80Context.Default;
var left = ExtF80Math.FromInt32(6);
var right = ExtF80Math.FromInt32(4);
var quotient = ExtF80Math.Divide(left, right, context);

Console.WriteLine(quotient.Value);
Console.WriteLine(quotient.Flags);

The rounding context is passed explicitly. CopperFloat does not use process-global or thread-local floating-point state.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.1 45 7/15/2026

First public preview of allocation-free extF80 arithmetic with explicit rounding contexts, raw encoding preservation, deterministic exception flags, and exactness-gated host acceleration.