Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Function DoubleAsInt is not implemented #1090

Open
rajkk1 opened this issue Jun 28, 2022 · 1 comment
Open

Function DoubleAsInt is not implemented #1090

rajkk1 opened this issue Jun 28, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rajkk1
Copy link

rajkk1 commented Jun 28, 2022

Describe the bug

When I try and run a function that uses DoubleAsInt() I get the error Cannot create an instance of Microsoft.Quantum.Convert.DoubleAsInt because it is an abstract class.

To Reproduce

open Microsoft.Quantum.Convert;

function TestDoubleAsInt(): Int {
    let value = 18.0;
    let result = DoubleAsInt(value);
    return result;
}

%simulate TestDoubleAsInt

Expected behavior

I would expect the output to be 18

Actual behavior

I get the error Cannot create an instance of Microsoft.Quantum.Convert.DoubleAsInt because it is an abstract class.

System information

  • OS: Windows

  • .NET Core Version: 6.0.100

  • Python Version: 3.9.12

Additional context
Q# reference for function: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.convert.doubleasint

@rajkk1 rajkk1 added the bug Something isn't working label Jun 28, 2022
@bettinaheim bettinaheim transferred this issue from microsoft/qsharp-runtime Jul 28, 2022
@cgranade
Copy link
Contributor

I apologize for the hassle, but after investing on the IQ# side, it looks like the root cause is that DoubleAsInt is missing from https://github.com/microsoft/qsharp-runtime/blob/21f5fab97682d9bc0ae8e3b58f679fdb952f1c24/src/Simulation/QSharpFoundation/Convert/Convert.cs, such that I will transfer your issue back to the qsharp-runtime repo. Thank you for your patience as we investigate your issue! 💕

@cgranade cgranade transferred this issue from microsoft/iqsharp Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants