-rw-r--r-- 2131 cryptattacktester-20230614/bigfloat_mpfi.h raw
#ifndef bigfloat_h
#define bigfloat_h
#include <iostream>
#include "bigint.h"
#include "bigint.h"
#include <mpfi.h>
class bigfloat {
mpfi_t x;
public:
static void set_default_precision(bigint);
static bigint get_default_precision(void);
~bigfloat() { mpfi_clear(x); }
bigfloat() { mpfi_init(x); }
bigfloat(const bigfloat &b) { mpfi_init_set(x,b.x); }
bigfloat &operator=(const bigfloat &b) { mpfi_set(x,b.x); return *this; }
bigfloat(int i) { mpfi_init_set_si(x,i); }
bigfloat(long i) { mpfi_init_set_si(x,i); }
bigfloat(unsigned int u) { mpfi_init_set_ui(x,u); }
bigfloat(unsigned long u) { mpfi_init_set_ui(x,u); }
bigfloat(double d) { mpfi_init_set_d(x,d); }
bigfloat(bigint i) { mpfi_init_set_z(x,i.unsafe_get_mpz_t()); }
bool definitely_zero();
bool definitely_positive();
bool definitely_positive_and_reasonably_precise(long = 20);
bool definitely_less(const bigfloat &);
bool maybe_between(double,double);
friend bool operator<(const bigfloat &,const bigfloat &);
friend bool operator>(const bigfloat &,const bigfloat &);
friend bigfloat operator+(const bigfloat &,const bigfloat &);
friend bigfloat operator-(const bigfloat &,const bigfloat &);
friend bigfloat operator-(const bigfloat &);
friend bigfloat operator*(const bigfloat &,const bigfloat &);
friend bigfloat operator/(const bigfloat &,const bigfloat &);
friend bigfloat& operator+=(bigfloat &,const bigfloat &);
friend bigfloat& operator*=(bigfloat &,const bigfloat &);
friend bigfloat log(const bigfloat &);
friend bigfloat log2(const bigfloat &);
friend bigfloat log1p(const bigfloat &);
friend bigfloat exp(const bigfloat &);
friend bigfloat expm1(const bigfloat &);
friend bigfloat exp2(const bigfloat &);
friend bigfloat pow(const bigfloat &,const bigfloat &);
friend bigint floor_as_bigint(const bigfloat &);
friend bigint ceil_as_bigint(const bigfloat &);
friend bigfloat bigfloat_guarantee_nonnegative(const bigfloat &);
friend bigfloat binomial_bigfloat(const bigfloat &,const bigint &);
friend std::ostream &operator<<(std::ostream &,const bigfloat &);
} ;
#endif