Jump to content

Recommended Posts

Posted (edited)

you could add a complex math case to a system like this.

case $macrocommand_setudv_arithmitic; udv math
  switch $macro[$macroid][$macrocommand[$macroid][0]][3];check for type of math
  case 0;plus
   $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][1]]= $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][2]]+$udvariable[$macro[$macroid][$macrocommand[$macroid][0]][4]]+ _
    $macro[$macroid][$macrocommand[$macroid][0]][5]
  case 1;minus
   $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][1]]= $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][2]]-$udvariable[$macro[$macroid][$macrocommand[$macroid][0]][4]]- _
    $macro[$macroid][$macrocommand[$macroid][0]][5]
  case 2;muliply
   $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][1]]= $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][2]]*$udvariable[$macro[$macroid][$macrocommand[$macroid][0]][4]]* _
    $macro[$macroid][$macrocommand[$macroid][0]][5]
  case 3;divide
   $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][1]]= $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][2]]/$udvariable[$macro[$macroid][$macrocommand[$macroid][0]][4]]/ _
    $macro[$macroid][$macrocommand[$macroid][0]][5]
  case 4;equal
    $udvariable[$macro[$macroid][$macrocommand[$macroid][0]][1]]= $macro[$macroid][$macrocommand[$macroid][0]][5]
  endswitch
  macrocommandinc($macroid)

I could be mistaken, I haven't put enough thought into it but fractions seem to be a way of looking at a number. X and Y can equal whatever you want. udv above stands for User Defined Variable or Value.

Edited by Xandy
Posted

I would do something like this:

$x = ((0-$b)+Sqrt(($b^2)-4*($a+$c)))/2*$a
$x = ((0-$b)-Sqrt(($b^2)-4*($a+$c)))/2*$a

AutoIT doesn't support the plus-minus operation as far as I am aware, and so you have to do the plus and the minus ones individually.

Posted (edited)

I need the special characters because i'm making one calculator which will calculate matrix equations, Bhaskara and etc.

I know how to do the calculations, i just wanted to show step-by-step what i'm doing, so i need the special symbols!

the symbols are just for display to users what is happening!

Edited by darkshark
Posted

special math symbols and functions.

+

-

*

/

Mod(dividend, divisor); modulus

abs(expression); absolute value

acos(expression); arccosine, I think it's a pasta dish

random(min, max, flag); my personal favorite

asin(expression); you goto hell for this

atan(expression); ... yah I only get this working outside in the summer

tan(expression); returns the tangent of expression

sin(expression);you can make the top half of a circle out of pixels

cos(expression);you can make the bottom half of a circle out of pixels

exp(expression);returns e raised to the power of expression

floor(expression); truncate decimal places. question: is there any reason to use this over int()?

round(expression, optional:decimalplaces); rounds the number to the selected decimal places, idk never used

please see the help file under autoit/function reference/math management.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...