mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-17 23:48:17 +02:00
Update list-pi.ps1
This commit is contained in:
parent
e17b81d653
commit
fdaa75ddfd
@ -4,7 +4,7 @@
|
|||||||
.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...
|
||||||
@ -14,7 +14,7 @@
|
|||||||
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)
|
||||||
@ -62,6 +62,7 @@ function List-Pi ( $Digits ) {
|
|||||||
$r = $nr
|
$r = $nr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Write-Host "... ($Digits digits)"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user