The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

Name

SPVM::Complex_2d - double Complex Type

Usage

  use Complex_2d;
  
  my $z : Complex_2d;
  
  # Set
  $z->{re} = 1.5;
  $z->{im} = 2.5;
  
  # Get
  my $re = $z->{re};
  my $im = $z->{im};
  

Description

Complex_2d is a multi-numeric type to represent a double complex number.

Fields

re

  has re : double;

A real number.

im

  has im : double;

A imaginary number.