TOP - Perl - 数値の書式

数値を記述する方法には以下の種類があります。
整数         : 100
浮動小数点数 : 100.123
               1.00123E2
16進数       : 0x64
8進数        : 0144

(例)
$n1 = 100;
$n2 = 100.123;
$n3 = 1.00123E2;
$n4 = 0x64;
$n5 = 0144;

print "n1 = " . $n1 . "\n";
print "n2 = " . $n2 . "\n";
print "n3 = " . $n3 . "\n";
print "n4 = " . $n4 . "\n";
print "n5 = " . $n5 . "\n";

実行結果
n1 = 100
n2 = 100.123
n3 = 100.123
n4 = 100
n5 = 100


Copyright(C) 2006-2011 CLAYPOT. All Rights Reserved.