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.
Functions for smallest and largest representable fixed point #594
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
Functions for smallest and largest representable fixed point
Conceptual overview
This provides two functions to return the smallest and largest representable fixed point based on number of integer and fractional bits.
This should be added to the Numerics package.
Proposal
New and modified functions, operations, and UDTs
namespace Microsoft.Quantum.Math {
/// # Summary
/// Returns the smallest representable number for specific fixed point dimensions
///
/// # Input
/// ## integerBits
/// Number of integer bits
/// ## fractionalBits
/// Number of fractional bits
///
/// # Remark
/// The value can be computed as $-2^{p-1}$, where $p$ is the number of integer bits.
function SmallestFixedPoint(integerBits : Int, fractionalBits : Int) : Double { ... }
/// # Summary
/// Returns the largest representable number for specific fixed point dimensions
///
/// # Input
/// ## integerBits
/// Number of integer bits
/// ## fractionalBits
/// Number of fractional bits
///
/// # Remark
/// The value can be computed as $2^{p-1} - 2^{-q}$, where $p$
/// is the number of integer bits and $q$ is the number of fractional bits.
function LargestFixedPoint(integerBits : Int, fractionalBits : Int) : Double { ... }
}Open questions
Which namespace fits well?
Microsoft.Quantum.ArithmeticMicrosoft.Quantum.CanonMicrosoft.Quantum.Math
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.