FreeKB - Perl (Scripting) Multiplication (*)
Perl (Scripting) - Multiplication (*)

This will print 10.

my $sum = 5 * 2;
print "$sum \n";

 

This will print "7.14".

my $sum = 5.1 * 1.4;
print "$sum \n";

 

This will round the result to a whole number.

use integer;
my $sum = 5.1 * 1.4;
print "$sum \n";

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter ea639 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |