XP is just a number | |
PerlMonks |
Re^3: Non-integer print output???by syphilis (Archbishop) |
on Sep 10, 2021 at 14:33 UTC ( [id://11136640]=note: print w/replies, xml ) | Need Help?? |
The exponentiation operator a**b is IIRC optimized to generally handle float input for a and b and is approximating the result. Does this arise because C's pow/powl/powq functions take floating point inputs and return floating point values ? I've always assumed so, without ever really knowing. I'm a little surprised that the C language doesn't provide a pow() function that takes and returns signed long int (or signed long long int) values - though I guess such a function would easily overflow for relatively low input values. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|