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

2 program chunks not giving the same result #92

Open
Overscore opened this issue Dec 10, 2023 · 1 comment
Open

2 program chunks not giving the same result #92

Overscore opened this issue Dec 10, 2023 · 1 comment

Comments

@Overscore
Copy link

Overscore commented Dec 10, 2023

The following program:

a=1
do
  a=a+a
  b=a+1
until a=b
print "a = ",a;

c=1
more:
c=c+c
d=c+1
if c<>d then goto more
print "c = ",c;

results in:
a = 16777216
c = 2.14748e+09
a and c shall be the same. It seems there is a bug somewhere.

When defining MB_DOUBLE_FLOAT, the result is:
a = 9.0072e+15
c = 9.0072e+15
This is correct.

I'm compiling with gcc 11.4.0 on ubuntu 22.04 with CFLAGS="-fomit-frame-pointer -O3 -Wunreachable-code -Wextra -Wall -std=c17 -m64 -fopenmp -march=native -mtune=native"
LDFLAGS="-m64 -s -lm"
The processor is an INTEL i9-13900-KF

@Overscore Overscore changed the title 2 program chunks not giving the sale result 2 program chunks not giving the same result Dec 10, 2023
@blazer2k1
Copy link

if you do if c < d then goto more then it doesn't overtake the value on the 2nd part.

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

No branches or pull requests

2 participants