Skip to content

Commit

Permalink
making tutorial_example printfs precision-agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonRayJones authored Mar 19, 2020
1 parent cbf820d commit 192be6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/tutorial_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ int main (int narg, char *varg[]) {

qreal prob;
prob = getProbAmp(qubits, 7);
printf("Probability amplitude of |111>: %f\n", prob);
printf("Probability amplitude of |111>: %g\n", prob);

prob = calcProbOfOutcome(qubits, 2, 1);
printf("Probability of qubit 2 being in state 1: %f\n", prob);
printf("Probability of qubit 2 being in state 1: %g\n", prob);

int outcome = measure(qubits, 0);
printf("Qubit 0 was measured in state %d\n", outcome);

outcome = measureWithStats(qubits, 2, &prob);
printf("Qubit 2 collapsed to %d with probability %f\n", outcome, prob);
printf("Qubit 2 collapsed to %d with probability %g\n", outcome, prob);



Expand Down

0 comments on commit 192be6a

Please sign in to comment.