Softanza
StartFrançais
Softanza
The library documents itself · Numeric & optimization

stzComplex

19 own methods · 8 forms written with extensions, listed under their method

the source: base/number/stzComplex.ring(opens in a new tab) · All classes · The area reference: Numeric & optimization

Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean

Examples: 0 come from the library's tests; 9 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzComplex(1, -2). 10 methods have none yet. Examples run on 2026-10-03 12:54 inside the library at commit 0e72e2e2c.

Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
RealPart
(no comment in the source: the name reads as a sentence) real part
composed example
o1 = new stzComplex(1, -2)
? o1.RealPart()
#--> 1
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) imaginary part 1 examples run
composed example
o1 = new stzComplex(1, -2)
? o1.ImaginaryPart()
#--> -2
composed from the signature, run for this page
no extension
Parts
(no comment in the source: the name reads as a sentence) parts
composed example
o1 = new stzComplex(1, -2)
? @@( o1.Parts() )
#--> [ 1, -2 ]
composed from the signature, run for this page
no extension
Content
"3+4i", "3-4i", "3" when the imaginary part is zero, "4i" when the real part isno extension
IsReal
(no comment in the source: the name reads as a sentence) is real
composed example
o1 = new stzComplex(1, -2)
? o1.IsReal()
#--> 0
composed from the signature, run for this page
no extension
IsImaginary
(no comment in the source: the name reads as a sentence) is imaginary
composed example
o1 = new stzComplex(1, -2)
? o1.IsImaginary()
#--> 0
composed from the signature, run for this page
no extension
IsZero
(no comment in the source: the name reads as a sentence) is zero
composed example
o1 = new stzComplex(1, -2)
? o1.IsZero()
#--> 0
composed from the signature, run for this page
no extension
Modulus
|z|. Via the hypotenuse rather than sqrt(re^2 + im^2), which overflows for parts above about 1e154 on values the answer handles perfectly well.also written: Magnitudeno extension
Argument
the angle from the positive real axis, in (-pi, pi]no extension
An ACTIVE verb mutates this number and returns nothing; the PASSIVE ...ed form returns the [re, im] DATA and leaves it alone; the Q twin returns a new stzComplex so calls chain. The first version of this class had Conjugate() and Negated() both returning new objects from plain names, which breaks the rule that a plain method returns data and only a Q form returns a Softanza object. 1 examples runQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) conjugated 1 examples run
composed example
o1 = new stzComplex(1, -2)
? @@( o1.Conjugated() )
#--> [ 1, 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
Negate
(no comment in the source: the name reads as a sentence) negate
composed example
o1 = new stzComplex(1, -2)
o1.Negate()
? o1.Content()
#--> -1+2i
composed from the signature, run for this page
QCSXTZZZIBWU
Negated
(no comment in the source: the name reads as a sentence) negated
composed example
o1 = new stzComplex(1, -2)
? @@( o1.Negated() )
#--> [ -1, 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
── arithmetic: DATA out, or a chainable object from the Q twin ── 1 examples runQCSXTZZZIBWU
Minus
(no comment in the source: the name reads as a sentence) minusQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) times 1 examples runQCSXTZZZIBWU
Smith's formula, for the same overflow reason as Modulus(): dividing through by the larger part first keeps the intermediates near 1. 1 examples runQCSXTZZZIBWU
Equals
(no comment in the source: the name reads as a sentence) equalsno extension