TransWikia.com

Is there a Q# funtion which returns the type of a variable?

Quantum Computing Asked on April 19, 2021

As the title says, I am asking myself is there is a specific function which returns the type of something. Ideally, I would work as follows :

let a = 4.0;
Message(Type(a));

This would print :

double

Is there anything similar to this ? I tried to look at the api, but didn’t find anything, I could definitely have missed something there.

One Answer

No, there isn't. We are avoiding having the means for types to impact the program flow, but I'd be interested to hear what the use case is. If is it only a matter of wanting to print the type rather than getting something that can be used within the program, then that is certainly something we could cover in the future (please consider making a feature request).

Correct answer by Bettina Heim on April 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP