This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
ModPowL may entry a loops when set exponent to "0L" #1106
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingneeds triageAn initial review by a maintainer is neededAn initial review by a maintainer is needed
Description
Description
When set exponent and modulus to 0L, in the source code, the function ModPowL should not enter the loop and return 1L. However, in the following test case, there is a Unhandled exception which indicates there is a divide by zero operation.
source code
| while runningExponent > 0L { |
Testcase
namespace NISLNameSpace {
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Intrinsic;
@EntryPoint()
operation main() : Unit {
let value = 1L;
let exponent = 0L;
let modulus = 0L;
let NISLModPowL = ModPowL(value,exponent,modulus);
Message($"{value}");
Message($"{exponent}");
Message($"{modulus}");
Message($"{NISLModPowL}");
}
}
Environment
operating system : Windows 10 and Ubuntu 18.06
dotnet version : 6.0.400
QDK : 0.25.228311
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds triageAn initial review by a maintainer is neededAn initial review by a maintainer is needed