darkshark Posted February 10, 2012 Share Posted February 10, 2012 Hi, is possible to use math symbols in autoit?for example:Fractions and etc?I can use this format on edit or richedit control!thanks a lot Link to comment Share on other sites More sharing options...
Xandy Posted February 10, 2012 Share Posted February 10, 2012 (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 February 10, 2012 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Mikeman27294 Posted February 10, 2012 Share Posted February 10, 2012 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. Link to comment Share on other sites More sharing options...
darkshark Posted February 10, 2012 Author Share Posted February 10, 2012 (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 February 10, 2012 by darkshark Link to comment Share on other sites More sharing options...
Xandy Posted February 10, 2012 Share Posted February 10, 2012 special math symbols and functions.+-*/Mod(dividend, divisor); modulusabs(expression); absolute valueacos(expression); arccosine, I think it's a pasta dishrandom(min, max, flag); my personal favoriteasin(expression); you goto hell for thisatan(expression); ... yah I only get this working outside in the summertan(expression); returns the tangent of expressionsin(expression);you can make the top half of a circle out of pixelscos(expression);you can make the bottom half of a circle out of pixelsexp(expression);returns e raised to the power of expressionfloor(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 usedplease see the help file under autoit/function reference/math management. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
golfinhu Posted February 10, 2012 Share Posted February 10, 2012 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 Link to comment Share on other sites More sharing options...
Xandy Posted February 10, 2012 Share Posted February 10, 2012 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. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now