MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / times

Method times

__test__/theorem.js:2105–2118  ·  view source on GitHub ↗
(complex)

Source from the content-addressed store, hash-verified

2103 return this.times(...arguments)
2104 }
2105 times(complex) {
2106 if (!complex.isComplex) {
2107 throw "[TheoremJS]: Complex operation require complex numbers"
2108 }
2109 const a = this.a
2110 const b = this.b
2111 this.a = a.times(complex.a).minus(b.times(complex.b))
2112 this.b = a
2113 .plus(b)
2114 .times(complex.a.plus(complex.b))
2115 .minus(a.times(complex.a))
2116 .minus(b.times(complex.b)) // (a+b)(c+d)-ac-bd.
2117 return this
2118 }
2119 toString() {
2120 return `${this.a.toString()} ${this.b.lt(0) ? "-" : "+"} ${this.b.abs().toString()}i`
2121 }

Callers 15

dividedByMethod · 0.95
multipliedByMethod · 0.95
time.jsFile · 0.80
volume.jsFile · 0.80
length.jsFile · 0.80
temperature.jsFile · 0.80
area.jsFile · 0.80
mass.jsFile · 0.80
speed.jsFile · 0.80
findRoots.jsFile · 0.80
pow.jsFile · 0.80
log.jsFile · 0.80

Calls 2

minusMethod · 0.80
plusMethod · 0.80

Tested by

no test coverage detected