Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Simulation/QSharpFoundation/Convert/Convert.qs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ namespace Microsoft.Quantum.Convert {
/// The 0 element of the array is the least significant bit of the big integer.
/// # Remarks
/// See [C# BigInteger constructor](https://docs.microsoft.com/dotnet/api/system.numerics.biginteger.-ctor?view=netframework-4.7.2#System_Numerics_BigInteger__ctor_System_Int64_) for more details.
/// Note that the Boolean array is padded of the right with `false` values to a length that is a multiple of 8,
/// and then treated as a little-endian notation of a positive or negative number following two's complement semantics.
///
/// # Example
/// ```qsharp
/// let bi1 = BoolArrayAsBigInt([true, false, true]); // Padded to 10100000 -> 5
/// let bi2 = BoolArrayAsBigInt([false, false, false, false, false, false, false, true]); // Not padded -> -128
/// ```
function BoolArrayAsBigInt(a : Bool[]) : BigInt {
body intrinsic;
}


/// # Summary
/// Converts a given boolean value to an equivalent string representation.
///
Expand Down