This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 179
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Conversion functions for signed integers #595
Copy link
Copy link
Closed
Labels
Area-APIIssue concerns the API design of a library, such as style guide or design principles adherence.Issue concerns the API design of a library, such as style guide or design principles adherence.Kind-EnhancementNew feature or requestNew feature or requestPkg-NumericsIssue relates to the Microsoft.Quantum.Numerics package.Issue relates to the Microsoft.Quantum.Numerics package.trackingThis label will trigger gh-sync to create or update a mirror internal ADO issue.This label will trigger gh-sync to create or update a mirror internal ADO issue.
Description
Conversion functions for signed integers
Conceptual overview
Returns Boolean arrays based on two's complement representations of signed integers.
This should be added to the Numerics package.
Proposal
New and modified functions, operations, and UDTs
namespace Microsoft.Quantum.Convert {
/// # Summary
/// Computes signed integer of two's complement encoding.
function BoolArrayAsSignedInt(bits : Bool[]) : Int { ... }
/// # Summary
/// Computes two's complement encoding as bit array from signed integer
function SignedIntAsBoolArray(number : Int, numBits : Int) : Bool[] { ... }
}Other functions
The following functions are related and might be discussed in a future API proposal:
namespace Microsoft.Quantum.Convert {
/// # Summary
/// Returns signed integer from bit encoding of unsigned integer
function IntAsSignedInt(number : Int, numBits : Int) : Int { ... }
/// # Summary
/// Returns unsigned integer from bit encoding of signed integer
function SignedIntAsInt(number : Int, numBits : Int) : Int { ... }
}(see also discussion in the comments)
Metadata
Metadata
Assignees
Labels
Area-APIIssue concerns the API design of a library, such as style guide or design principles adherence.Issue concerns the API design of a library, such as style guide or design principles adherence.Kind-EnhancementNew feature or requestNew feature or requestPkg-NumericsIssue relates to the Microsoft.Quantum.Numerics package.Issue relates to the Microsoft.Quantum.Numerics package.trackingThis label will trigger gh-sync to create or update a mirror internal ADO issue.This label will trigger gh-sync to create or update a mirror internal ADO issue.