Types

I have based these notes on this reference. Characters and strings have the usual functions available, review the options at the reference provided.

 $StringValue = "Yoo hoo!"
$StringValue.ToUpper()
$StringValue.ToLower()

You should be familiar with the concept of an array and iterating through it. When iterating, the first value is [0].

$MyArray = 1,2,3,4,5
$MyArray[1]

Rather than a single Integer type, we have int for 32-bit numbers and long for 64-bit numbers. These are signed, so an int can store +/- 2^31 values, the first bit denotes positive or negative. A long can store +/- 2^63 values. There is also a value for byte.

$LittleNumber = 12345
$LittleNumber.GetType()
$BigNumber = 123456789123456789
$BigNumber.GetType()

In floating point, we have 32- and 64-bit options again, single/float and double precision numbers.

[float]$Floaty32 = 12.12
$Floaty32.GetType()
[double]$Floaty64 = 12345.1234
$Floaty64.GetType()

Interestingly, there is also a 128-bit decimal type.

Review the reference provided, in particular the math types, although we do not need trigonometry in this module, we use it everywhere in science and engineering. The usual orders of precedence apply, but I use brackets to keep everything clear for myself.

Last updated