math: BND_MATH_FLOAT selects the float engine as the default#8
Merged
Conversation
Completes the engine-selection story: the unqualified bnd::math::fn now has a THREE-way default — cordic under BND_MATH_FIXED/BND_MATH_NO_FP, flt under BND_MATH_FLOAT, else dbl. (cordic::/dbl::/flt:: stay individually reachable regardless; the macro only picks what the bare name means.) - The 21 public transcendentals + the 3 circle/degree forms gained an `#elif defined(BND_MATH_FLOAT)` branch routing to the float cores (flt::*_core / flt::detail::d_* / flt::store), mirroring the existing dbl path. - CMake: -DBOUND_MATH_FLOAT=ON → BND_MATH_FLOAT (ignored under FIXED). New CI cell: linux gcc Release (float). - Conversion fix: `static_cast<float>(bound)` is invalid/ambiguous (bounds expose operator double, not float), so all bound/rational→float inputs go through double first — `static_cast<float>(static_cast<double>(x))`, exact and deterministic. (Base is imax → stays a direct float cast.) - test_determinism's golden pins are the DEFAULT engine's values; the float engine is a third value set, so those cases are scoped `#ifndef BND_MATH_FLOAT` (float determinism is pinned in test_math_engines). The default-alias test gained a BND_MATH_FLOAT branch. Verified: default 404/404, CORDIC 442/442, FLOAT 395/395. Deferred to the next PR (Phase 4b-ii): the f32 storage flag + real->f64 rename. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4b (part 1) —
BND_MATH_FLOATdefault selectionCompletes the engine-selection story from PR #7. The unqualified
bnd::math::fnnow has a three-way default:bnd::math::fnBND_MATH_FIXED/BND_MATH_NO_FPcordicBND_MATH_FLOATflt(binary32)dbl(binary64)cordic::/dbl::/flt::remain individually reachable regardless — the macro only changes what the bare name means.Changes
#elif defined(BND_MATH_FLOAT)branch routing to the float cores (flt::*_core/flt::detail::d_*/flt::store), mirroring the existingdblpath.-DBOUND_MATH_FLOAT=ON→BND_MATH_FLOAT(ignored underFIXED). New CI cell: linux gcc Release (float).static_cast<float>(bound)is invalid/ambiguous (bounds exposeoperator double, notfloat), so bound/rational→float inputs go through double —static_cast<float>(static_cast<double>(x)), exact and deterministic. (Baseisimax→ direct cast.)test_determinism's golden pins are the default engine's values; the float engine is a third value set, so those cases are scoped#ifndef BND_MATH_FLOAT(float determinism is pinned intest_math_engines). The default-alias test gained aBND_MATH_FLOATbranch.Verification
default 404/404, CORDIC 442/442, FLOAT 395/395 (determinism cases compile out under float, covered by the float golden pins).
Deferred to the final Phase-4 PR: the
f32storage flag +real→f64rename.🤖 Generated with Claude Code