struct Complex
Overview
A complex number is a number represented in the form a + bi. In this form, a and b are real numbers, and i is an imaginary number such as i² = -1. The a is the real part of the number, and the b is the imaginary part of the number.
NOTE To use Complex
, you must explicitly import it with require "complex"
require "complex"
Complex.new(1, 0) # => 1.0 + 0.0.i
Complex.new(5, -12) # => 5.0 - 12.0.i
1.to_c # => 1.0 + 0.0.i
1.i # => 0.0 + 1.0.i
Defined in:
ssz/codec.crClass Method Summary
Instance Method Summary
Instance methods inherited from class Object
ssz_basic? : Bool
ssz_basic?,
ssz_encode(io : IO)ssz_encode : Bytes ssz_encode, ssz_fixed? : Bool ssz_fixed?, ssz_size : Int32 ssz_size, ssz_variable? : Bool ssz_variable?
Class methods inherited from class Object
ssz_basic? : Bool
ssz_basic?,
ssz_decode(io : IO, size : Int32 = 0)ssz_decode(bytes : Bytes) ssz_decode, ssz_fixed? : Bool ssz_fixed?, ssz_variable? : Bool ssz_variable?