Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Debug!!! Debug!!!!! Php language!!!! You can see expected output and my output b

ID: 3904388 • Letter: D

Question

Debug!!! Debug!!!!!

Php language!!!! You can see expected output and my output below.

This is program below:

[-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

Explanation / Answer

For the provided question, I would suggest you use the bcpowmod function of PHP. This function is used to raise an arbitrary precision number to another, reduced by modulus.

String bcpowmod(string $lo,string $ro,string $mod, [int $scale])

where scale is an optional parameter used to set the number of digits after the decimal place in the result.

You can rewrite the function ModularExponentian as:

function ModularExponential($a,$b,$n){

$d=bcpowmod($a,$b,$n);

return $d}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote