uid | title | ms.date | ms.topic | qsharp.kind | qsharp.namespace | qsharp.name | qsharp.summary |
---|---|---|---|---|---|---|---|
Microsoft.Quantum.Diagnostics.FiniteFact |
FiniteFact function |
7/28/2023 12:00:00 AM |
managed-reference |
function |
Microsoft.Quantum.Diagnostics |
FiniteFact |
Checks whether a given floating-point value represents a finite number, and throws an exception if this is not the case. |
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
The floating-point value that is to be checked.
Failure message to be used as an error message if d
is either
not finite, or not a number.
The following Q# code will throw an exception:
FiniteFact(NaN(), "NaN is not a finite number.");
- Microsoft.Quantum.Diagnostics.Fact