SPVM::Float(3)
β¨ SPVM::Float β¨
Okay bestie, so this is SPVM::Float β a page from the Perl docs, and honestly? It's giving tiny but mighty. π
πΈ Name πΈ
SPVM::Float β literally just A float value as An Object. That's the whole vibe. A float that decided to become an object and live its best life. π¦
π Description π
So the Float class in SPVM represents a float value as an object. That's it, that's the tweet. A raw float said "no cap, I want object energy," and now here we are. β¨
π Usage π
Here's how you actually use it, bestie β look at this, it's so clean:
my $float_object = Float->new(5);
my $float_value = $float_object->value;
You make the object with Float->new(5), then you pull the value back out with ->value. Iconic. Round trip complete. π«Ά
π₯ Details π₯
- This class is immutable. Once it's made, it's made β no take-backs, no edits, she's locked in. π
- This class is automatically loaded. You don't gotta do anything, she just shows up. Main character energy fr fr. π«
π Interfaces π
Stringableβ yes, she can stringify. We love a versatile queen. π
π Fields π
value
has value : ro float;
That's the value. Read-only (ro), because immutability is the whole point, remember? π
π§ Class Methods π§
new
static method new : Float ($value : float);
Creates a shiny new Float object with a float $value. You hand it a float, it hands you back an object. Perfect little transaction. π
β Instance Methods β
to_string
method to_string : string ();
Casts the value to string type and returns it. Your float, but as a string now. Slay. β¨
π Copyright & License π
Copyright (c) 2023 Yuki Kimoto
MIT License
And that's a wrap, bestie! π This page was brought to you by perl v5.42.2, dated 2026-02-03, and it lives in the manual as SPVM::Float(3). Go forth and float 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