-
Notifications
You must be signed in to change notification settings - Fork 1
Enhanced math support #28
Comments
That's what I'm doing next, probably next week. Still not sure exactly what I'm going to do, but variables that start and end with a bracket will be evaluated as an expression: |
I suppose putting expressions within "expansion" can work. But having the ability to assign values to variables within the expression is mighty handy. Also, the ability to reference variables without expansion is also great. The SET /A syntax and capabilities is one of the best implemented features of cmd.exe in my opinion, and worthy of emulating when adding long and/or floating point capability. I can't say that about any other cmd features. For example, I was delighted to discover that something like
works exactly as expected. Maybe you could add additional options to the existing SET command. Like |
Variables are part of the calculator library, so that expression should work, too. Conditionals are there, too, so you could do something like I was initially going to do something like that (but with |
I have often implemented crude conditionals by intentionally dividing by zero, For example, issue new line every 5th iteration:
Or do an additional computation only every 5th iteration
But this does not support multiple conditions or else branches within the expression. A more elegant conditional construct would be welcome. Another nice addition would be logical operators.
There is the logical It would be nice to have logical |
I think the calculator has boolean operators, but adding them to IF is way too complicated, unfortunately. Hm, I'll have to see about adding string comparisons to the calculator, that might be a simple workaround. |
I have no idea how it would be implemented, but it would be nice if SET /A could be patched or an
@extension
could be made to provide support for 64 bit integers and or floating point math.The text was updated successfully, but these errors were encountered: