Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Debug!!! Debug!!!!! Php language!!!! You can see expected output and my output below. This is program below:
Debug!!! Debug!!!!!
Php language!!!! You can see expected output and my output below.
This is program below:
/** * Created by PhpStorm. * User: zhongbojun * Date: 2018/6/11 * Time: ??10:59 */ function getBinaryList($HugeNumber){ $List =array(); $check =true; while ($check) { if ($HugeNumber > 0) { array_push($List, $HugeNumber % 2); $HugeNumber = floor($HugeNumber / 2); }else{ $check = false; } } return $List; } function ModularExponentian($a,$b,$n){ $d =1; $List =getBinaryList($b); for ($i =sizeof($List)-1;$i>=0;$i--){ $d = ($d*$d)%$n; if ($List[$i]==1){ $d = ($d*$a)%$n; } } return $d; } $a = $argv[1]; $b = $argv[3]; $n = $argv[2]; echo "123^132431144777777777666"," mod ",989," = ",ModularExponentian(123,132431144777777777666,989);[-l Test Case Random Official Test Case (./common/testCases/input001.txt) Expected Output 83 92873912873928172938749238749283749823743912873912873 mod 31 17 Program Output 83 92873912873928172938749238749283749823743912873912873 mod 31 -3 -l Test Case Random Official Test Case (../common/testCases/input002.txt) Expected Output 2323894"23497238473984723987492387429387492387420394803298403982049832 9983409382097109378240192830912483049812 mod 31-7 Program Output 2323894"2349723847398472398749238742938749238742039480329840398204983209834093820971093782401928309124830498?2 mod 31-19
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started