Sujet : Re: 100 Random Single Variable Linear Equations
De : porkchop (at) *nospam* invalid.foo (Mike Sanders)
Groupes : comp.lang.awkDate : 07. Dec 2024, 02:36:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vj08q1$2mf7i$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Christian Weisgerber <
naddy@mips.inka.de> wrote:
I suspect Mike used '*' as as short-hand for "a multiplication
sign" and not specifically the asterisk.
Yes that's exactly the case (sorry for any confusion folks).
The code simply generates problems for the student/enthusiast
to solve. The books I've read use the symbols we all know.
But some older books complained that: 5y is ambiguous &
would be better expressed as: 5 * y, where * is the actual
multiplication symbol in the book & y is the variable.
In the code posted, I'm using 7bit ASCII for all operators:
* multiplication 2 * 2 = 4
/ division 4 / 2 = 2
+ addition 2 + 2 = 4
- subtraction 2 - 2 = 0
^ power 2 ^ 2 = 4
_nth subscript a_1 (1st element in array a[1])
% modulus
< less than
greator than
& and
| or
(), [], {} order does not matter, evaluate inner
to outer before outside expressions
{2 / [(x + y + z) - 2]}
r! factorial 4! = 4 * 3 * 2 * 1 = 24
= equals
!= not equal
~ approximately equal
f(a, b) = a + 10 function definition
how to handle matrices?
[x y
0 1]
[x y]
[0 1]
-- :wqMike Sanders