I just made a simple workout for the ABC theory, example:
You have the formule: 2x + 3 = 0
You can work this out like.. -3 on both sides, so 2x = - 3
You do it all / 2, and you'll have x = - 1.5... but now
You've got this formule: -33.5x² + 1.5x + 4 = 0, how are we going to do this?
Fill in for;
a: -33.5
b: 1.5
c: 4
PHP Code:
function onCreated() {
a = - 33.5;
b = 1.5;
c = 4;
/* Don't edit below here */
xr = "";
D = ( b ^ 2) - 4 * a * c;
if ( D > NULL) {
for ( try: { "-", "+"}) {
if ( try = "-")
xr = ( - b - ( D ^ 0.5)) / ( 2 * a);
else if ( try = "+")
xr @= " or " @ ( - b + ( D ^ 0.5)) / ( 2 * a);
}
}
else if ( D = NULL) {
xr = - b / ( 2 * a);
}
else
xr = "No solutions!";
echo( "Result: " @ xr);
}
And as you see, the result will be (for 'x' in the formule);
Result: 0.368659933 or -0.323883813
You don't realy have anything that you can use it for in Graal, but whatever, wanted to work it out in a script
