Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/math/precision marks a number as deliberately double precision. F64 is a type-only brand on number, and asF64(value) returns its argument unchanged with that brand. Nothing is rounded, validated, clamped or coerced to an integer, and no wrapper object exists at runtime. Supported lowerers read the brand as the ordinary f64 representation.

import { asF64, type F64 } from "@maruaudio/dsp/math/precision"

let accumulator: F64 = asF64(0)
accumulator = asF64(accumulator + 0.1)

Functions

NameInputOutputDomain
F64typenumber & { __maruNumericIntent: "f64" }Type only; no runtime value
asF64value: numberthe same number, typed F64Every JS number, including NaN, ±Infinity and −0

Lifecycle

None. The DSP node has no state and no preparation; the manifest calls it a type-only marker and a pure scalar identity.

When to use it

Mark an accumulator, coefficient or phase whose precision must stay f64 when a narrowing build profile would otherwise be free to choose a narrower storage. The processor contract explains when that matters and when ordinary number is enough.

Limits

  • A brand cannot authorize narrowing or unchecked access, and it performs no runtime check; an as F64 cast is equally unchecked.
  • It does not make other expressions f64 or f32. Float32Array storage and existing Math.fround points keep their own meaning.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

None: this node imports no other node.

Dependents

No other node imports this one.

Used by

No plugin with a published composition uses this node yet.