NAME

SPVM::Comparator::Float - A Callback Type for float Comparation

SYNOPSYS

use Comparator::Float;

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

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

DESCRIPTION

Comparator::Float is a callback type to compare two float values.

CALLBACK METHOD

method : int ($a : float, $b : float);

The implementation 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.