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

Consider ternary operations #2

Open
the4thamigo-uk opened this issue Aug 24, 2020 · 0 comments
Open

Consider ternary operations #2

the4thamigo-uk opened this issue Aug 24, 2020 · 0 comments

Comments

@the4thamigo-uk
Copy link
Owner

In a system of operations on quantities, there might be common operations on more than two quantities e.g. A,B,C.

You break down this into two binary operations (e.g. ABC = A*(BC)), but in some cases the result of one of the operations (e.g. the operation BC), could be a scalar. This requires that A must have binary operation defined with a scalar, in order to complete the calculation :

Scalar = B*C;
A = A * Scalar;

Having operations on quantities with scalars is dangerous for the programmer, as there is less control over what is being passed into the operator. In some cases, if A,B,C might only ever be expected to be used in a ternary multiplication, then it would be safer to allow the definition of such operations in the configuration file :

A = ABC;

This avoids the 'dangerous' scalar multiplication operator.

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

1 participant