+
Point of view
All features
expanded class COMPLEX_GENERAL [A_SIZE -> FLOAT]
Summary
Common ancestor of all complex types: COMPLEX_32, COMPLEX_64, ...
Direct parents
Insert list: EXCEPTIONS, MATH_CONSTANTS, NUMERIC
Known children
Insert list: COMPLEX_32, COMPLEX_64
Overview
Features
{ANY}
  • set_i
    Set Current to the imaginary unit
  • set (a_real_part: A_SIZE, an_imaginary_part: A_SIZE)
  • set_cartesian (a_real_part: A_SIZE, an_imaginary_part: A_SIZE)
  • set_polar (a_modulus: A_SIZE, a_phase: A_SIZE)
{ANY}
Cartesian representation
{ANY}
Polar representation
{ANY}
Object Printing:
{ANY}
Maths constants:
{ANY}
Various exceptions codes:
{ANY}
{ANY}
Status report:
{ANY}
Basic operations:
{ANY}
  • die (code: INTEGER_32)
    Terminate execution with exit status code, without triggering an exception.
  • raise (name: STRING)
    Raise a developer exception of name name.
  • throw (a_exception: EXCEPTION)
Non-Standard Extensions:
{ANY}
{}
set_i
effective procedure
{ANY}
Set Current to the imaginary unit
set (a_real_part: A_SIZE, an_imaginary_part: A_SIZE)
effective procedure
{ANY}
set_cartesian (a_real_part: A_SIZE, an_imaginary_part: A_SIZE)
effective procedure
{ANY}
set_polar (a_modulus: A_SIZE, a_phase: A_SIZE)
effective procedure
{ANY}
infix "+" (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Sum with other (commutative).
infix "-" (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Result of subtracting other.
infix "*" (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Product by other.
infix "/" (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Division by other.
require
  • other /= Void
  • not other.is_equal(zero)
  • divisible(other)
infix "^" (e: INTEGER_32): COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
prefix "+": COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Unary plus of Current.
prefix "-": COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Unary minus of Current.
divisible (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): BOOLEAN
effective function
{ANY}
May Current be divided by other ?
require
  • other /= Void
hash_code: INTEGER_32
effective function
{ANY}
The hash-code value of Current.
ensure
  • good_hash_value: Result >= 0
real_sign: INTEGER_8
effective function
{ANY}
Sign of Current (0 -1 or 1).
ensure
  • Result.in_range(-1, 1)
sign: COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
require
is_zero: BOOLEAN
effective function
{ANY}
zero: COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Neutral element for "+" and "-".
one: COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Neutral element for "*" and "/".
i: COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
Imaginary unit
is_equal (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): BOOLEAN
effective function
{ANY}
Is other attached to an object considered equal to current object?
require
    • other /= Void
    • other /= Void
ensure
  • Result implies hash_code = other.hash_code
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
is_near_equal (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): BOOLEAN
effective function
{ANY}
infix "~=" (other: COMPLEX_GENERAL [A_SIZE -> FLOAT]): BOOLEAN
effective function
{ANY}
conjugate: COMPLEX_GENERAL [A_SIZE -> FLOAT]
effective function
{ANY}
real: A_SIZE
writable attribute
{ANY}
imaginary: A_SIZE
writable attribute
{ANY}
modulus: A_SIZE
effective function
{ANY}
ensure
  • non_negative: Result.sign /= -1
phase: A_SIZE
effective function
{ANY}
require
squared_modulus: A_SIZE
effective function
{ANY}
ensure
  • non_negative: Result.sign /= -1
out: STRING
effective function
{ANY}
do
   Result := "("
   real.append_in(Result)
   Result.append(once ", ")
   imaginary.append_in(Result)
   Result.append_character(')')
fill_tagged_out_memory
effective procedure
{ANY}
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
require
    • locked: tagged_out_locked
    • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
Pi: REAL_64
is 3.1415926535897932384626
constant attribute
{ANY}
Pi
Pi_2: REAL_64
is 1.5707963267948966192313
constant attribute
{ANY}
Pi divided by 2
Pi_4: REAL_64
is 0.7853981633974483096156
constant attribute
{ANY}
Pi divided by 4
Inv_pi: REAL_64
is 0.31830988618379067153
constant attribute
{ANY}
Inverse pi
Sqr_2pi: REAL_64
is 2.50662827463100050241
constant attribute
{ANY}
Square root of 2 pi
Tau: REAL_64
is 6.2831852707795864769252
constant attribute
{ANY}
Tau (2Pi)
Sqr_tau: REAL_64
is 2.50662827463100050241
constant attribute
{ANY}
Square root of Tau
Inv_tau: REAL_64
is 0.15915494401391811225565
constant attribute
{ANY}
Inverse of tau
Evalue: REAL_64
is 2.7182818284590452353602
constant attribute
{ANY}
e (Euler's number)
Inv_evalue: REAL_64
is 0.36787944117144232159
constant attribute
{ANY}
Inverse e
Deg: REAL_64
is 57.2957795130823208767981
constant attribute
{ANY}
Degrees/Radian
Phi: REAL_64
is 1.6180339887498948482045
constant attribute
{ANY}
Golden Ratio
Cheb: REAL_64
is 0.59017029950804811302
constant attribute
{ANY}
Chebyshev constant
Zeta_2: REAL_64
is 1.64493406684822643647
constant attribute
{ANY}
Riemann Function
Check_instruction: INTEGER_32
is 1
constant attribute
{ANY}
Exception code for violated check.
Class_invariant: INTEGER_32
is 2
constant attribute
{ANY}
Exception code for violated class invariant.
Developer_exception: INTEGER_32
is 3
constant attribute
{ANY}
Exception code for developer exception.
See also: raise, throw
Incorrect_inspect_value: INTEGER_32
is 4
constant attribute
{ANY}
Exception code for inspect statement.
This exception occurs when Void is passed as the expression to inspect ("inspect on STRING only). This exception also occurs when the inspected value selects no branch (when the keyword "else" not used, one "when" branch _must_ be selected). Some value which is not one of the inspect constants, if there is no Else_part r
Loop_invariant: INTEGER_32
is 5
constant attribute
{ANY}
Exception code for violated loop invariant
Loop_variant: INTEGER_32
is 6
constant attribute
{ANY}
Exception code for non-decreased loop variant
No_more_memory: INTEGER_32
is 7
constant attribute
{ANY}
Exception code for failed memory allocation
Postcondition: INTEGER_32
is 8
constant attribute
{ANY}
Exception code for violated postcondition.
Precondition: INTEGER_32
is 9
constant attribute
{ANY}
Exception code for violated precondition.
Routine_failure: INTEGER_32
is 10
constant attribute
{ANY}
Exception code for failed routine.
Os_signal: INTEGER_32
is 11
constant attribute
{ANY}
Exception code for a signal received from the OS.
Void_attached_to_expanded: INTEGER_32
is 12
constant attribute
{ANY}
Exception code for attachment of Void value to expanded entity.
Void_call_target: INTEGER_32
is 13
constant attribute
{ANY}
Exception code for feature applied to Void reference
System_level_type_error: INTEGER_32
is 14
constant attribute
{ANY}
Exception code for the system-level type error (this kind of error mostly arise with covariant redefinition).
exception_name: STRING
effective function
{ANY}
name_of_exception (a_exception: INTEGER_32): STRING
effective function
{ANY}
developer_exception: EXCEPTION
effective function
{ANY}
The last developer-thrown exception.
require
developer_exception_name: STRING
effective function
{ANY}
Name of last developer-raised exception.
require
is_developer_exception: BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception?
is_developer_named_exception: BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception?
is_developer_exception_of_name (name: STRING): BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception of name name?
assertion_violation: BOOLEAN
effective function
{ANY}
Is last exception originally due to a violated assertion or non-decreasing variant?
exception: INTEGER_32
{ANY}
Code of last exception that occurred.
is_signal: BOOLEAN
effective function
{ANY}
Is last exception originally due to an external event (operating system signal) ?
die (code: INTEGER_32)
effective procedure
{ANY}
Terminate execution with exit status code, without triggering an exception.
raise (name: STRING)
effective procedure
{ANY}
Raise a developer exception of name name.
require
  • name /= Void
throw (a_exception: EXCEPTION)
effective procedure
{ANY}
require
  • a_exception /= Void
signal_number: INTEGER_32
{ANY}
Signal Number received from OS.
 Zero if exception is not an OS signal.
named_exception: NAMED_EXCEPTION
once function
{}
developer_exception_memory: REFERENCE[EXCEPTION]
once function
{}
raise_exception (code: INTEGER_32)
{}