Open hofirstb19 opened 2 years ago
The real running code is here. https://github.com/microsoft/qsharp-runtime/blob/1ac2e3cd154145536fab030b728b4439526d2bb3/src/Simulation/QSharpFoundation/Math/Math.cs#L105 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.
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
https://github.com/microsoft/qsharp-runtime/blob/f56539bd799c5f47e01a9baf648b63a063b21a88/src/Simulation/QSharpFoundation/Math/Math.qs#L327
Testcase
Environment
operating system : Windows 10 and Ubuntu 18.06 dotnet version : 6.0.400 QDK : 0.25.228311