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

Evaluating an equation with →Num #1057

Open
c3d opened this issue Jul 27, 2024 · 1 comment
Open

Evaluating an equation with →Num #1057

c3d opened this issue Jul 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@c3d
Copy link
Owner

c3d commented Jul 27, 2024

When evaluating an equation like 'A*A+B*B=C*C' with →Num, we get a True or False result. Would it be preferable to see the left and right results?

@c3d c3d added the enhancement New feature or request label Jul 27, 2024
@Wiljea
Copy link

Wiljea commented Aug 9, 2024

I think you're right and this should clearly generalize to logical expression as well:
'express1 logical_operator express2' for instance 'AA+BB<C*C'. To implement this, 2 possibles scenarios:
S1 : invoke →Num (or ASN) two times in a row with the expression values as a first result and the logical value after the second time. OR an interesting possibility
S2: A first call shows a tagged result of the form 'AA+BB<C*C'ˍ?:True and the second call to →Num (or ASN) would simply remove the tag from any object of the form 'express'ˍ?:Log_Val to finally leave on the stack the logical value alone.
(May be, if →Num and ASN are distinct operation, ASN would give directly the logical value).
Remark about S2: it may seem strange to use the notation ˍ? as if it was a unit but wouldn't it possible to consider some kind of a logical unit because if express1 and express2 are themselves logical expression (e.g. A>B, C=3) then for instance
'A>B AND C=3'ˍ? would act as an alternate logical operation with a definitive answer. Is it an interesting suggestion ? I wonder ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants