You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
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.
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
The text was updated successfully, but these errors were encountered:
It raises an exception correctly because this program tries to make the divisor 0. Moreover, I'd like to know when this code will execute, because this may decide whether it is necessary to add more operation for the situation that modulus=0.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugSomething isn't workingneeds triageAn initial review by a maintainer is needed
Description
When set
exponent
andmodulus
to0L
, in the source code, the functionModPowL
should not enter the loop and return1L
. However, in the following test case, there is aUnhandled exception
which indicates there is a divide by zero operation.source code
qsharp-runtime/src/Simulation/QSharpFoundation/Math/Math.qs
Line 327 in f56539b
Testcase
Environment
operating system : Windows 10 and Ubuntu 18.06
dotnet version : 6.0.400
QDK : 0.25.228311
The text was updated successfully, but these errors were encountered: