UUlpNacre
Product

Product features · Finite binary64 ULP distance

01

Use ulp_distance.py to examine binary64 spacing across zero while keeping representable steps distinct from numerical accuracy.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Finite binary64 ULP distance

● ● ●UlpNacre●
A concrete starting point · Finite binary64 ULP distance ×
import math, struct

def ulp_distance(a, b):
    if any(type(x) is not float or not math.isfinite(x) for x in (a, b)):
        raise ValueError("ulp.finite")
    def key(value):
        bits = struct.unpack(">Q", struct.pack(">d", value))[0]
        magnitude = bits & ((1 << 63)-1)
        return (1 << 63)-magnitude if bits >> 63 else (1 << 63)+magnitude
    return abs(key(a)-key(b))
✳Finite binary64 ULP distance
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗