Added complete call-seq documentation for all Complex methods in
mrblib/complex.rb (18 methods):
## Complex Class Methods:
- polar: creates complex number from polar coordinates (magnitude, angle)
with trigonometric conversion using Math.cos and Math.sin
## Complex Instance Methods:
- inspect, to_s: string representation methods for debugging and display
with proper formatting of real and imaginary parts
- +@, -@: unary plus and minus operators for identity and negation
- <=>: spaceship operator for comparison with other numeric types,
enables Comparable module functionality with proper nil handling
- abs/magnitude: absolute value (magnitude) calculation using hypot
- abs2: square of absolute value for performance-critical calculations
- arg/angle/phase: argument (angle) calculation using atan2
- conjugate/conj: complex conjugate operation (negates imaginary part)
- fdiv: floating-point division ensuring float results
- polar: returns [magnitude, angle] array representation
- real?: always returns false for complex numbers
- rectangular/rect: returns [real, imaginary] array representation
- to_c: returns self (identity conversion)
- to_r: converts to rational when imaginary part is zero, raises RangeError otherwise
## Numeric Extension Methods:
- i: creates pure imaginary number (0+num*i) for convenient complex creation
- to_c: converts any numeric to complex with zero imaginary part
Co-authored-by: Atlassian Rovo Dev
- define `MRB_TT_COMPLEX`
- change object structure (`struct RComplex`)
- add memory management for `MRB_TT_COMPLEX`
- avoid operator overloading as much as possible
- as a result, performance improved a log
- should work with and without `Rational` defined
* The `Fixnum` constant is now an alias for the `Integer` class.
* Remove `struct mrb_state::fixnum_class` member.
If necessary, use `struct mrb_state::integer_class` instead.