Update list-pi.ps1

This commit is contained in:
Markus Fleschutz 2022-12-04 10:23:03 +01:00
parent e17b81d653
commit fdaa75ddfd

View File

@ -2,19 +2,19 @@
.SYNOPSIS .SYNOPSIS
Lists PI Lists PI
.DESCRIPTION .DESCRIPTION
This PowerShell script calculates and lists the digits of the mathematical constant PI. This PowerShell script calculates and lists the digits of the mathematical constant PI.
.PARAMETER digits .PARAMETER digits
Specifies the number of digits to list (10000 by default) Specifies the number of digits to list (1000 by default)
.EXAMPLE .EXAMPLE
PS> ./list-pi PS> ./list-pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342... 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342...
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
param([int]$Digits = 10000) param([int]$Digits = 1000)
function List-Pi ( $Digits ) { function List-Pi ( $Digits ) {
$Big = [bigint[]](0..10) $Big = [bigint[]](0..10)
@ -61,7 +61,8 @@ function List-Pi ( $Digits ) {
$n = $nn $n = $nn
$r = $nr $r = $nr
} }
} }
Write-Host "... ($Digits digits)"
} }
try { try {