-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathArithmetic.qs
More file actions
18 lines (16 loc) · 753 Bytes
/
Arithmetic.qs
File metadata and controls
18 lines (16 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
namespace ExpressionsExamples {
open Microsoft.Quantum.Intrinsic;
/// # Summary
/// The collection of examples of arithmetic expressions.
operation ArithmeticExamples() : Unit {
Message("============================== Q# expressions: arithmetic expressions ==============================");
// Arithmetic expressions are defined for Int, BigInt, and Double types.
Message($"intAddition = {42 + 13}");
Message($"bigIntSubtraction = {42L - 13L}");
Message($"doubleMultiplication = {42. * 13.}");
Message($"intDivision = {42 / 13}");
Message($"bigIntNegation = {-42L}");
Message($"doubleExponentiation = {42. ^ 13.}");
Message($"intModulus = {42 % 13}");
}
}