Sign in to follow this  
Followers 0
darkshark

Is Possible use Math Symbols in autoit?

7 posts in this topic

Hi, is possible to use math symbols in autoit?

for example:

Posted Image

Fractions and etc?

I can use this format on edit or richedit control!

thanks a lot

Share this post


Link to post
Share on other sites



#2 ·  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

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  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

Share this post


Link to post
Share on other sites

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.


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Thanks a lot Xandy, i will look it all!

I'm working in the calculator now, when i finish it, i post the calculator here :)

Share this post


Link to post
Share on other sites

The people who make Autoit and the help file possible are responsible for the awesomeness of Autoit. They also enable communication via this forum, yah their pretty frick'n cool.


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0