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

Sci Calc: Functions don't produce correct intermediate values #741

Closed
inexorabletash opened this issue Feb 8, 2023 · 0 comments
Closed
Labels
bug Desk Accessories DA bugs, feature requests, or new DA requests
Milestone

Comments

@inexorabletash
Copy link
Collaborator

inexorabletash commented Feb 8, 2023

This works as expected:

1 + 2 SIN = - yields 1 + SIN(2) = 1.909...

This doesn't:

1 SIN + 2 = - should yield SIN(1) + 2 = 2.841

... but actually yields 2 + whatever the previous result was (might be 0 so 2, etc)

The root cause is that farg is never updated after the function is used:

In the first example:

  • 1 FAC = 1
  • + farg = ROUND(FAC); last_op = +
  • 2 FAC = 2
  • SIN FAC = SIN(FAC)
  • = FAC = farg + FAC

In the second:

  • 1 FAC = 1
  • SIN FAC = SIN(FAC)
  • + last_op = +
  • 2 FAC = 2
  • = FAC = farg + FAC
@inexorabletash inexorabletash added bug Desk Accessories DA bugs, feature requests, or new DA requests labels Feb 8, 2023
@inexorabletash inexorabletash changed the title Sci CalcTitle (ten words or less) Sci Calc: Functions don't produce correct intermediate values Feb 8, 2023
@inexorabletash inexorabletash added this to the 1.3 milestone Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Desk Accessories DA bugs, feature requests, or new DA requests
Projects
None yet
Development

No branches or pull requests

1 participant