mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-08 05:03:59 -05:00
31 lines
464 B
C++
31 lines
464 B
C++
/*
|
|
* FixInput.cpp
|
|
*
|
|
*/
|
|
|
|
#include "FixInput.h"
|
|
|
|
#include <math.h>
|
|
|
|
template<>
|
|
void FixInput_<Integer>::read(std::istream& in, const int* params)
|
|
{
|
|
double x;
|
|
in >> x;
|
|
items[0] = round(x * exp2(*params));
|
|
}
|
|
|
|
template<>
|
|
void FixInput_<bigint>::read(std::istream& in, const int* params)
|
|
{
|
|
#ifdef HIGH_PREC_INPUT
|
|
mpf_class x;
|
|
in >> x;
|
|
items[0] = x << *params;
|
|
#else
|
|
double x;
|
|
in >> x;
|
|
items[0] = round(x * exp2(*params));
|
|
#endif
|
|
}
|