Given that Perl is written in C and iirc follows the same rules, I'd expect $str2 to be promototed to float/double during the calc, then, given the tgt is float/double, I'd expect a float/double result, NOT an integer.# int vs float $str1 = 0.00; $str2 = 0; $str1 += $str2; print "str1 $str1\n"; Result: str1 0
In reply to Integer vs Float during addition by chrism01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |