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

using the fdiv variable name when dividing with floating point float / single causes a hangup #101

Closed
GSoftwareDevelopment opened this issue Apr 30, 2022 · 2 comments

Comments

@GSoftwareDevelopment
Copy link
Contributor

GSoftwareDevelopment commented Apr 30, 2022

uses crt;

const
  freq_ratio = 4;

var
  freq:float;
  fdiv:byte;
  tpq:longint;
  qtm:longint;

begin
  qtm:=454545;
  tpq:=120;
  freq:=1/((qtm/1000000)/tpq)*freq_ratio;
  fdiv:=round(64000/freq);
  writeLn(fdiv);
end.

The above code will cause the computer to hang. This is because a variable named fdiv is used, which conflicts with a math procedure of the same name.

tebe6502 added a commit that referenced this issue May 1, 2022
tebe6502 added a commit that referenced this issue May 1, 2022
tebe6502 added a commit that referenced this issue May 1, 2022
@tebe6502
Copy link
Owner

tebe6502 commented May 1, 2022

issue #101 fixed

@GSoftwareDevelopment
Copy link
Contributor Author

Thank you :)

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