Arithmetic/Integer: Difference between revisions

(Add Bash example)
Line 1,112:
Write-Host "Product: $($a * $b)"
Write-Host "Quotient: $($a / $b)"
Write-Host "Quotient, explicitlyround roundedto even: $([Math]::Round($a / $b))"
Write-Host "Remainder: , sign follows first: $($a % $b)"</lang>
Numbers are automatically converted to accomodate for the result. This means not only that Int32 will be expanded to Int64 but also that a non-integer quotient will cause the result to be of a floating-point type.
 
Anonymous user