Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
PowerShell offers several options for interacting with numbers and numeric data.
To define a variable that holds numeric data, simply assign it as you would other variables. PowerShell automatically stores your data in a format that is sufficient to accurately hold it.
$myInt = 10
$myInt gets
the value of 10, as a (32-bit)
integer.
$myDouble = 3.14
$myDouble
gets the value of 3.14, as a (53-bit,
9 bits of precision) double.
To explicitly assign a number as a long (64-bit) integer or decimal (96-bit, 96 bits of precision), use the long and decimal suffixes:
$myLong = 2147483648L
$myLong
gets the value of 2147483648, as a
long integer.
$myDecimal = 0.999D