Yes, I know those circumventions are possible, but the computer should adapt to the user, not vice verca.
The user should not have to remember to add an extra space after a minus sign.
Yes, I know those circumventions are possible, but the computer should adapt to the user, not vice verca.
The user should not have to remember to add an extra space after a minus sign.
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
(a+b)(c+d) does work fine. In some situations the parentheses surrounding the expression don't show when they should, so I'll have to tweak that.
x(a+b) isn't allowed because x() is handled like a function. Graphing calculators have the same problem. The only way I can see to allow that is to differentiate between functions and variables at run-time, which means pre-defining the names of each before using them.
I might be able to tweak minus signs to work correctly in situations. Graphing calculators solve this problem by having a different minus sign than their negative sign. Anyone have any ideas for rules regarding the dash? (ie: if letter before and afterwards, it's a minus sign)
Wouldn't it always be possible to interpret it as a negative sign?
4-n = 4+(-n)
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
But that could also beOriginally posted by XSquared
Wouldn't it always be possible to interpret it as a negative sign?
4-n = 4+(-n)
4-n = 4(-n)
Most people would probably write that as 4*-n though, or use 4(-n). I don't think anyone would type 4-n and intend 4 times negative n.
edit: impressive program anyway
Last edited by confuted; 05-18-2003 at 02:14 PM.
Away.
so... ignoring whitespace, it's a minus sign unless
1) It's preceded by a plus sign
2) it's preceded by a parenthesis
3) it's the first character in the string
4) it's preceded by a '*'
This sound good?
thanks for your input, btw
So you can't divide by a negative number, according to your rules...
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
5) It's preceded by a '/'Originally posted by XSquared
So you can't divide by a negative number, according to your rules...
BTW, the '/' serves to raise the next factor in the string by -1 power. Negative signs are skipped past, because there's never any intention to divide just by a negative 1.