On Thu, 22 Jan 2026 00:35:05 GMT, Joe Darcy <[email protected]> wrote:

> First cut at a version of complex numbers using the textbook algorithms for 
> the arithmetic operations. This version is intended for prototyping and _not_ 
> for production use.

src/java.base/share/classes/java/lang/ComplexTextbook.java line 195:

> 193:         } else {
> 194:             return false;
> 195:         }

Suggestion:

        return that instanceof ComplexTextbook c && real == c.real && imag == 
c.imag;

src/java.base/share/classes/java/lang/ComplexTextbook.java line 393:

> 391:         double b = c.imag;
> 392:         return StrictMath.hypot(a, b);
> 393:     }

Since we have `abs()`, is there a reason for not having `theta()` (or `arg()`, 
or whatever)?

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1942#discussion_r2716308811
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1942#discussion_r2716328488

Reply via email to