Post Reply 
multiple arguments, variable arguments, default values
04-17-2021, 04:32 PM (This post was last modified: 04-19-2021 05:14 PM by compsystems.)
Post: #2
RE: multiple arguments, variable arguments, default values
Testing the code in the simulator

QF(1,2,3) [enter] returns "Error: Invalid input"

PHP Code:
export parallelResistors_homeab, ... )
begin
  c 
:= concatab);
  return 
Σlist(1/c);
end
parallelResistors_home( 2, 4, 3 ) [enter] returns
0.92307692308 > 1 / ( ½ + ¼ + 1/3) // ok

parallelResistors_home( 2, 4 ) [enter] returns
1.33333333333...∞ > 1 / ( ½ +¼ )
exact(Ans) [enter] 4/3

parallelResistors_home( 1, 2, 4, 3, 5 ) [enter] returns
0.43795620438 > 1 / ( 1 + ½ + ¼ + 1/3 + 1/5 ) // ok


PHP Code:
#cas
parallelResistors_casab, ... ):=
begin
  c 
:= concatab);
  return 
Σlist(1/c);
end;
#end 
[Check] returns "Error: Syntax Error in program line 2"

parallelResistors_cas(R_1, R_2, R_3) > 1 / ( (1/R_1) +(1/R_2)+1/R_3) ) > R_1*R_2*R_3 / (R_1*R_2 + R_1*R_3 + R_2*R_3)
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-17-2021 04:32 PM



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