Message
par compsystems » sam. nov. 18, 2017 1:45 pm
Hello
A idea, a second argument that indicates what type of result awaits
QPI(expr) default function
case 1: qpirlne( expr, 0) -> Quotient with pi or root or ln or e
Q
case 2: qpirlne( expr, 1) if it does not find the equivalent to quotient without pi, root, ln, e, it returns the same value (input expr)
case 3: qpirlne( expr, 2) if it does not find the equivalent to quotient2 without pi, root, ln, e, it returns the same value (input expr)
PI
case 4: qpirlne( expr, 3) if it does not find the equivalent to PI, it returns the same value (input expr)
ROOT
case 4: qpirlne( expr, 4) if it does not find the equivalent to root, it returns the same value (input expr)
LN
case 5: qpirlne( expr, 5) if it does not find the equivalent to ln, it returns the same value (input expr )
e
case 6: qpirlne( expr, 6) if it does not find the equivalent to e, it returns the same value (input expr )
within a program it is required to express a decimal number in various formats
[php]ex0:
qpirlne( (2*π/3)+(3*π/4) , 0) -> 17/12*π
qpirlne( (2*π/3)+(3*π/4) , 1) -> 1137949/255685 // Q1
qpirlne( (2*π/3)+(3*π/4) , 2) -> 4+(115209/255685) // Q2
qpirlne( (2*π/3)+(3*π/4) , 3) -> 17/12*π // PI
qpirlne( (2*π/3)+(3*π/4) , 4) -> (2*π/3)+(3*π/4) // ROOT
qpirlne( (2*π/3)+(3*π/4) , 5) -> (2*π/3)+(3*π/4) // LN
qpirlne( (2*π/3)+(3*π/4) , 6) -> (2*π/3)+(3*π/4) // e
ex1:
qpirlne( LN(3*π)-LN(√(5)), 0) -> LN( (3*π*√(5)/5) )
qpirlne( LN(3*π)-LN(√(5)), 1) -> 55715/38728 // Q1
qpirlne( LN(3*π)-LN(√(5)), 2) -> 1+(16987/38728) // Q2
qpirlne( LN(3*π)-LN(√(5)), 3) -> LN( (3*π*√(5)/5) ) // PI
qpirlne( LN(3*π)-LN(√(5)), 4) -> LN( (3*π*√(5)/5) ) // ROOT
qpirlne( LN(3*π)-LN(√(5)), 5) -> LN( (3*π*√(5)/5) ) // LN
qpirlne( LN(3*π)-LN(√(5)), 6) -> LN(3*π)-LN(√(5)) // e
ex2:
qpirlne( LN((2/5))-LN(√(2)), 0) -> -LN((25/2))/2
qpirlne( LN((2/5))-LN(√(2)), 1) -> -116599/92329 // Q1
qpirlne( LN((2/5))-LN(√(2)), 2) -> -1+(-24270/92329) // Q2
qpirlne( LN((2/5))-LN(√(2)), 3) -> LN((2/5))-LN(√(2)) // PI
qpirlne( LN((2/5))-LN(√(2)), 4) -> LN((2/5))-LN(√(2)) // ROOT
qpirlne( LN((2/5))-LN(√(2)), 5) -> -LN((25/2))/2 // LN
qpirlne( LN((2/5))-LN(√(2)), 6) -> LN((2/5))-LN(√(2)) // e
ex3:
qpirlne( e^(2*π/(3*√(7))), 0) -> e^((2*π*√(7)/21))
qpirlne( e^(2*π/(3*√(7))), 1) -> 224192/101585 // Q1
qpirlne( e^(2*π/(3*√(7))), 2) -> 1+(21022/101585) // Q2
qpirlne( e^(2*π/(3*√(7))), 3) -> e^(2*π/(3*√(7))) // PI
qpirlne( e^(2*π/(3*√(7))), 4) -> e^(2*π/(3*√(7))) // ROOT
qpirlne( e^(2*π/(3*√(7))), 5) -> e^(2*π/(3*√(7))) // LN
qpirlne( e^(2*π/(3*√(7))), 6) -> e^(2*π/(3*√(7))) // e
ex4:
qpirlne( 7*π/√(90), 0) -> 7*π*√(10)/30
qpirlne( 7*π/√(90), 1) -> 171470/73971
qpirlne( 7*π/√(90), 2) -> 260521/112387
qpirlne( 7*π/√(90), 3) -> 7*π/√(90)
ex5:
qpirlne( 1/(3+i*√(3)), 0) -> (1/4)-i*((√(3)/12))
qpirlne( 1/(3+i*√(3)), 1) -> (1/4)-(1/4)*i*√(1/3) // Q1
qpirlne( 1/(3+i*√(3)), 2) -> (1/4)-(i*37829/262087) // Q1
qpirlne( 1/(3+i*√(3)), 3) -> 1/(3+i*√(3)) // PI
qpirlne( 1/(3+i*√(3)), 4) -> (1/4)-i*((√(3)/12)) // ROOT
qpirlne( 1/(3+i*√(3)), 5) -> 1/(3+i*√(3)) // LN
qpirlne( 1/(3+i*√(3)), 6) -> 1/(3+i*√(3)) // e
ex ...:
SIN((π/8))
SIN((π/10))
COS((π/12))
COS((3*π/4))
ACOS((-1/2))
[/php]
Dernière modification par
compsystems le dim. nov. 19, 2017 2:47 pm, modifié 1 fois.