Skip to content

Conversation

@cbmarini
Copy link
Collaborator

This resolves #695: in Compare1 the floats are now compared in raw mode if level>=1 (so if function arguments with floats are compared to each other). As a result, the following program:

#StartFloat 20
CFunction f;
Local F = f(1.00000000000000001)+f(1.0);
Print;
.end

results in

   F =
      f(1.0e+00) + f(1.0e+00);

This is because in raw form 1.00000000000000001 and 1.0 are different, even though the first exceeds the 20 bits of precision.

Furthermore, it fixes the bug that was in the following program:

#StartFloat 30
Symbol a,b;
CFunction f;
Local F = 1.0*f(a);
.sort
#endfloat

Local F = F + f(a);
Print;
.end

@coveralls
Copy link

coveralls commented Jul 15, 2025

Coverage Status

coverage: 52.795% (+0.1%) from 52.682%
when pulling 7a05914 on cbmarini:fix-issue-695
into 25d6346 on form-dev:master.

@cbmarini
Copy link
Collaborator Author

As this fixes #695 and is an important fix for the floating point system, it is good to merge it already. I will make a separate issue about what the proper behaviour of the above program should be.

@cbmarini cbmarini merged commit e5c6050 into form-dev:master Jul 15, 2025
84 checks passed
@cbmarini cbmarini deleted the fix-issue-695 branch September 23, 2025 11:31
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.

Disappearing term after evaluate

2 participants