If I write this:
function f(n: Int) : Double {
return 1.5*n;
}
I get an error:
The arguments to the binary operator do not have a common base type.
Apparently I need a function to turn n
from an Int
into a Double
. There are lots of functions going from double to int, like Microsoft.Quantum.Extensions.Math.Floor
, but I wasn't able to find anything from int to double.
"qsharp"
as a search term rather thanQ#
. The query"qsharp" convert int to double
returnsToDouble
as the second hit for me in a private tab. $\endgroup$