Skip to content

perf(rust): toFixed in machine arithmetic - #91

Merged
kommander merged 1 commit into
devfrom
perf/stack-08-tofixed
Nov 26, 2026
Merged

kommander merged 1 commit into
devfrom
perf/stack-08-tofixed

Conversation

@hearnadam

Copy link
Copy Markdown
Contributor

It formatted every number to 1,100 decimal places and cut the text. The scaled
product's rounding error comes from a fused multiply-add, which says which way
the true value rounds; the exact path stays for what that cannot decide. A test
holds the two equal on over 500,000 cases.


Part 8 of 11 in a stack; based on perf/stack-07-bigint. Each part was built, linted and tested on its own (cargo test --release --workspace, the same under PSYCHOSCRIPT_GC_STRESS=1, and the conformance cases under PSYCHOSCRIPT_ROUNDTRIP=1). Numbers are instructions retired, from rust/bench/examples/corpus and mem_probe (part 1).

@hearnadam
hearnadam added this pull request to stack #95 November 26, 2026 17:17
@hearnadam
hearnadam force-pushed the perf/stack-08-tofixed branch from 27a7044 to 9202aa7 Compare November 26, 2026 17:20
@kommander
kommander force-pushed the perf/stack-08-tofixed branch 5 times, most recently from 5ef35d9 to 84dc024 Compare November 26, 2026 22:54
Base automatically changed from perf/stack-07-bigint to dev November 26, 2026 22:55
It formatted every number to 1,100 decimal places and cut the text. The scaled
product's rounding error comes from a fused multiply-add, which says which way
the true value rounds; the exact path stays for what that cannot decide. A test
holds the two equal on over 500,000 cases.
@kommander
kommander force-pushed the perf/stack-08-tofixed branch from 84dc024 to fbbcebb Compare November 26, 2026 22:55
@kommander
kommander merged commit f5c9330 into dev Nov 26, 2026
1 check passed
@kommander
kommander deleted the perf/stack-08-tofixed branch November 26, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants