Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigger integers #1548

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Bigger integers #1548

wants to merge 1 commit into from

Conversation

Negabinary
Copy link
Contributor

Found some more integers at the end of the number line, thought we might want them in Hazel.

image

This pr replaces the integers in Hazel with big integers, similar to python 3.0's approach to integers. Means we can't get integer overflows, and importantly for my work means integers are a little more mathematically well-behaved.

I tried running my AoC code on this branch and it didn't cause any slowdown.

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 44.26230% with 34 lines in your changes missing coverage. Please review.

Project coverage is 50.31%. Comparing base (4390190) to head (1582656).

Files with missing lines Patch % Lines
src/haz3lcore/dynamics/Transition.re 20.00% 16 Missing ⚠️
src/haz3lcore/dynamics/Builtins.re 45.45% 6 Missing ⚠️
src/util/BigInt.re 0.00% 6 Missing ⚠️
src/haz3lcore/dynamics/EvaluatorError.re 0.00% 2 Missing ⚠️
src/haz3lcore/dynamics/Unboxing.re 50.00% 2 Missing ⚠️
src/haz3lcore/statics/Coverage.re 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1548      +/-   ##
==========================================
- Coverage   50.33%   50.31%   -0.02%     
==========================================
  Files         103      103              
  Lines       10442    10444       +2     
==========================================
- Hits         5256     5255       -1     
- Misses       5186     5189       +3     
Files with missing lines Coverage Δ
src/haz3lcore/lang/term/Grammar.re 65.98% <100.00%> (-1.37%) ⬇️
src/haz3lcore/pretty/ExpToSegment.re 79.45% <100.00%> (+0.05%) ⬆️
src/haz3lcore/statics/MakeTerm.re 75.69% <100.00%> (ø)
src/haz3lmenhir/AST.re 80.92% <100.00%> (+0.30%) ⬆️
src/haz3lcore/dynamics/EvaluatorError.re 0.00% <0.00%> (ø)
src/haz3lcore/dynamics/Unboxing.re 22.60% <50.00%> (+0.77%) ⬆️
src/haz3lcore/statics/Coverage.re 71.72% <66.66%> (ø)
src/haz3lcore/dynamics/Builtins.re 62.65% <45.45%> (-0.93%) ⬇️
src/util/BigInt.re 0.00% <0.00%> (ø)
src/haz3lcore/dynamics/Transition.re 30.85% <20.00%> (ø)

... and 5 files with indirect coverage changes

};

let float_of_int = d => {
let-unbox n = (Int, d);
Some(fresh(Float(float_of_int(n))));
Some(fresh(Float(Bigint.to_float(n))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time for bigfloat

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