Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

complex

🌌complex

complex -- complex numbers based on arbitrary numeric type

complex provides complex numbers based on a numeric type (e.g. f64, i32).
A complex number consists of a real and an imaginary part.

just for brevity


redefines Object.asString:


redefines numeric.infix !=:


redefines numeric.infix *:
basic operations: 'infix *' (multiplication)


redefines numeric.infix +:
basic operations: 'infix +' (addition)


redefines numeric.infix -:
basic operations: 'infix -' (substraction)


redefines numeric.infix /:
basic operations: 'infix /' (division)

NYI: total order ignoring imag
redefines ordered.infix <:
does this come strictly before other?


redefines partiallyOrdered.infix <=:
does this come before other?

comparison
redefines numeric.infix ==:
comparison


redefines ordered.infix >:
does this come strictly after other?


redefines ordered.infix >=:
does this come after other?


redefines numerics.one:
identity element for 'infix *'


redefines partiallyOrdered.orderedThis:
get value of type T.

NYI: Once Eiffel-style 'like this' works, we can use 'like this' instead of
T and no longer need this feature.

basic operations
redefines numeric.prefix +:
basic operations: 'prefix +' (identity)

enable generic features in ancestors
redefines numeric.thiz:
get numeric.this value of type T. This is used for a generic implemention
of some features (e.g. prefix -, abs

NYI: these three should be implemented in complexes, not here:
redefines numerics.zero:
identity element for 'infix +'