FiniteFact function
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Diagnostics
Package: Microsoft.Quantum.QSharp.Foundation
Checks whether a given floating-point value represents a finite number, and throws an exception if this is not the case.
function FiniteFact (d : Double, message : String) : Unit
Input
d : Double
The floating-point value that is to be checked.
message : String
Failure message to be used as an error message if d
is either
not finite, or not a number.
Output : Unit
Example
The following Q# code will throw an exception:
FiniteFact(NaN(), "NaN is not a finite number.");
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for