SPVM::C...:Double(3)
π Name π
Okay so welcome to SPVM::C...:Double(3), bestie β this page comes from the User Contributed Perl Documentation manual, and the main character is SPVM::Comparator::Double: the interface type for the double comparation callback. π
β¨ Usage β¨
Here's the usage example, literally verbatim:
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 the interface type for the double comparation callback. No cap, that's the whole vibe. π«Ά
πΈ Interface Methods πΈ
The required method is exactly this signature:
required method : int ($a : double, $b : double);
This method must receive two values whose types are double, and it returns the following value:
- If the first argument is greater than the second argument, it returns
1. β - If the first argument is lower than the second argument, it returns
-1. π - If the first argument is equal to the second argument, it returns
0. β¨
π Copyright & License π
Copyright (c) 2023 Yuki Kimoto
MIT License
Stay slaying, bestie π β this page is from perl v5.42.2 and dated 2026-02-03.
π¦ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms