Skip to content

Commit

Permalink
WASM IO stream precision
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Dec 6, 2024
1 parent 13c7450 commit 0e8b70f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wasm_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ void qstabilizer_out_to_file(quid sid, std::string f)

std::ofstream ofile;
ofile.open(f.c_str());
ofile.precision(17);
ofile << std::dynamic_pointer_cast<QStabilizerHybrid>(simulators[sid]);
ofile.close();
}
Expand All @@ -868,6 +869,7 @@ void qstabilizer_in_from_file(quid sid, std::string f)

std::ifstream ifile;
ifile.open(f.c_str());
ifile.precision(17);
ifile >> std::dynamic_pointer_cast<QStabilizerHybrid>(simulators[sid]);
ifile.close();

Expand Down Expand Up @@ -2793,6 +2795,7 @@ void qcircuit_out_to_file(quid cid, std::string f)
CIRCUIT_LOCK_GUARD_VOID(cid)
std::ofstream ofile;
ofile.open(f.c_str());
ofile.precision(17);
ofile << circuit;
ofile.close();
}
Expand All @@ -2802,6 +2805,7 @@ void qcircuit_in_from_file(quid cid, std::string f)
CIRCUIT_LOCK_GUARD_VOID(cid)
std::ifstream ifile;
ifile.open(f.c_str());
ifile.precision(17);
ifile >> circuit;
ifile.close();
}
Expand All @@ -2810,6 +2814,7 @@ std::string qcircuit_out_to_string(quid cid)
{
CIRCUIT_LOCK_GUARD_TYPED(cid, "")
std::stringstream ss;
ss.precision(17);
ss << circuit;
return ss.str();
}
Expand Down

0 comments on commit 0e8b70f

Please sign in to comment.