SPVM::Comparator::Double(3)

NAME
SPVM::Comparator::Double - Comparator::Double in SPVM | a callback interface for double comparation

SYNOPSYS
  use Comparator::Double;

  my $comparator : Comparator::Double = method : int ($a : double, $b : double); {
    return $a <=> $b;
  };

  my $result = $comparator->(3, 5);

DESCRIPTION
Comparator::Double is a callback interface to compare two double values.

CALLBACK METHOD INTERFACE
  method : int ($a : double, $b : double);

This method must receive two numbers and return 1 if $a is more than $b, -1 if $x is less than $b, 0 if $a equals $b in the implementation.

This method is planned to be implemented in other classes.