Post Reply 
multiple arguments, variable arguments, default values
04-19-2021, 08:39 PM
Post: #5
RE: multiple arguments, variable arguments, default values
> ... turn on Complex mode to see the results.

change flag externally

HComplex:=00; [enter] 00 // a+b*i format and complex solutions off
QF(1,2,3) [enter] returns "Error: Invalid input" > "Unreral"

HComplex:=01; [enter] 01 // a+b*i format and complex solutions on
QF(1,2,3) [enter] {−1+1.41421356238*i, −1-1.41421356238*i } [ab/c] {−1+√2*i,−1-√2*i}

HComplex:=11; [enter] 11 // a+b*i> (a,b) format and complex solutions on
QF(1,2,3) [enter] { (−1, 1.41421356238),(−1, −1.41421356238 )}

change the flag internally within a code
PHP Code:
EXPORT QF(a,b,c)
BEGIN
 LOCAL d
;
 
HComplex:=01;
 
d:=b^2-4*a*c;
 RETURN (
−b+{1,−1}*(d))/(2*a);
END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: multiple arguments, variable arguments, default values - compsystems - 04-19-2021 08:39 PM



User(s) browsing this thread: 1 Guest(s)