Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Zahlen > Einfache Zuweisung

Einfache Zuweisung

Für die Definition einer Variablen, die numerische Daten enthält, weisen Sie diesen Wert einfach genau so zu, wie Sie das auch bei anderen Variablen machen würden. Die PowerShell speichert Ihre Daten automatisch in einem Format ab, das ausreichend ist, um diese Daten richtig vorzuhalten.

$myInt = 10

$myInt erhält den Wert 10 als (32-Bit-)Integer.

$myDouble = 3.14

$myDouble erhält den Wert 3,14 als Double (53 Bit, 9 Bit Genauigkeit).

Um einen Wert explizit als Long Integer (64 Bit) oder als Dezimal (96 Bit, 96 Bit Genauigkeit) zuzuweisen, setzen Sie die Suffixe Long und Decimal ein:

$myLong = 0.999L

$myLong erhält den Wert 1 als Long Integer.

$myDecimal = 0.999D

$myDecimal erhält den Wert 0,999.

Die PowerShell unterstützt auch die Exponentialschreibweise:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint