Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

PowerShell bug?? % (Mod) does not work with large numbers? Anyone know why?

$
0
0

$pow = [system.math]::Pow(1237,25)

$pow

$res =  $pow % 351

$res

 

Here is one part of a Diffie Hellman key exchange formula, in PS v4 $res comes out to be 35, however the real answer should be 67 which I verified on two independent calculators.

Does anyone know why powershell is not calculating this number correctly? 

Actually I am not sure if the pow and/or %  are the problem here?


Viewing all articles
Browse latest Browse all 6937

Trending Articles