SPVM::C...r::Float(3)
π NAME π
Okay so bestie, this is the manual for SPVM::Comparator::Float β Interface Type for float Comparation Callback. It's a User Contributed Perl Documentation page, and the header up top gets all truncate-y and shows SPVM::C...r::Float(3); same manual, just terminal-core. The full name to remember is SPVM::Comparator::Float, no cap. π
π» USAGE π»
Here's the exact usage vibe β the cast is doing its thing, then you call the comparator:
use Comparator::Float;
my $comparator = (Comparator::Float)method : int ($a : float, $b : float); {
return $a <=> $b;
};
my $result = $comparator->(3, 5);
The way that $comparator->(3, 5) slays β it's literally just calling the callback. β¨
πΈ DESCRIPTION πΈ
Comparator::Float is the interface type for the float comparation callback. That's it β that's the whole description, and it's iconic. It's giving "small but mighty" interface energy: no cap, it's the type for float comparation callbacks. π¦
β¨ INTERFACE METHODS β¨
required method : int ($a : float, $b : float);β bestie, this method is required, and it must receive two values whose types arefloat. It returns the following value, and the return rules are giving very specific:- 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. β¨
- If the first argument is greater than the second argument, it returns
So if you're implementing it: compare the first argument to the second and return those exact values. Periodt. π
π COPYRIGHT & LICENSE π
- Copyright (c) 2023 Yuki Kimoto β yes, that's the copyright line, keep it exact.
- MIT License β that's the license, and it's literally right there. π«Ά
Okay that's the whole page, bestie. Sign-off vibes: source/version is perl v5.42.2, the date is 2026-02-03, and the footer also rocks the shortened SPVM::C...r::Float(3) title. Byeee, go compare some floats responsibly πβ¨
π¦ 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