It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
1.00143781 = $110.85916557
1.0014378 = $110.85916446
1.001437 = $110.85907590
1.00143 = $110.85830100
1.0014 = $110.85498000
1.001 = $110.81070000
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
# reads a number with thousand separators in it and one character that the value is put into v
# the last character read is left in c. The first character read in is c after that
# characters are read in from in.
templatevoid read_with_commas(istream& in, fp_type & v, char & c) {
int sign = 1;
if (c == '-') {
sign = -1;
c = in.get();
}
v = 0.0;
while (c != '.') {
if (c != ',') {
if (isdigit(c)) {
v *= 10;
v += (c - '0');
} else {
return;
}
}
c = in.get();
}
if (c == '.') {
fp_type order = 1;
c = in.get();
while (isdigit(c) || c==',') {
if (c != ',') {
order /= 10;
v += order * (c - '0');
}
c = in.get();
}
}
}
templatevoid print_with_commas(ostream& os, fp_type v) {
char comma = use_facet>(cout.getloc()).thousands_sep();
if (v < 0) {
os << "-";
v = -v;
}
fp_type this_error = v * pow(10,-sig_figs);
long long integer_part = (long long)v;
int exp = 0;
long long power10_exp = 1;
while (power10_exp * 10 < integer_part) {
power10_exp *= 10;
exp++;
}
// skip leading zeroes
while (exp > 0 && (((integer_part / power10_exp) % 10) == 0)) {
power10_exp /= 10;
--exp;
}
// power_exp < integer_part < power_exp * 10
int limit = sig_figs;
while (exp > 0) {
os << (char)(((integer_part / power10_exp) % 10) + '0');
power10_exp /= 10;
if (exp % 3 == 0)
os << comma;
--exp;
--limit;
}
os << (char)((integer_part % 10)+'0');
fp_type dv(v);
if ((dv - integer_part) != 0 && limit > 0) {
// now we use for past the decimal place
os << ".";
unsigned short digit;
dv -= integer_part;
exp = -1;
while (this_error < dv && --limit > 0) {
dv *= 10;
this_error *= 10;
digit = (unsigned short)dv;
os << digit;
if (exp-- % 3 == 0)
os << comma;
dv -= digit;
}
}
}
templateclass btc_complex : public complex {
public:
btc_complex() : complex() {}
btc_complex(fp_type x) : complex(x) {}
btc_complex(fp_type a, fp_type b) : complex(a,b) {}
};
ostream& operator << (ostream& os, const btc_complexz) {
print_with_commas(os, z.real());
if (z.imag() != 0) {
os << "+";
print_with_commas(os, z.imag());
os << "I";
}
return os;
}
ostream& operator << (ostream& os, const btc_complexz) {
print_with_commas(os, z.real());
if (z.imag() != 0) {
os << "+";
print_with_commas(os, z.imag());
os << "I";
}
return os;
}
ostream& operator << (ostream& os, const btc_complexz) {
print_with_commas(os, z.real());
if (z.imag() != 0) {
os << "+";
print_with_commas(os, z.imag());
os << "I";
}
return os;
}
templateistream& operator >> (istream& in, btc_complex & z) {
fp_type real, imag;
char c = in.get();
read_with_commas(in, real, c);
if (c =='I' || c=='i') {
z = btc_complex(0,real);
} else if (c == '+') {
read_with_commas(in, imag, c);
if (c != 'I') {
in.setstate(ios::failbit);
}
z = btc_complex(real,imag);
} else {
z = real;
in.putback(c);
}
return in;
}
struct test_case {
double val;
string lit;
};
int main(int argc, char **argv) {
{
try {
cout.imbue(std::locale("en_US"));
} catch ( ... ) {
}
test_case tests[] = { { 43112279.75467,"43,112,279.754,67"} , {0.0101020204,"0.010,102,020,4"}, {0.00000001,"0.000,000,01"} };
BOOST_FOREACH(test_case c, tests) {
ostringstream oss;
complexoz = c.val;
btc_complexz = c.val;
try {
oss.imbue(std::locale("en_US"));
} catch ( ... ) {
cout << c.val << " = " << z << endl;
oss << z;
if (oss.str() == c.lit) {
cout << "test successful." << endl;
} else {
cout << "test failed: expected " << c.lit << ", but got " << oss.str() << endl;
}
oss.str( "" );
}
BOOST_FOREACH(test_case c, tests) {
istringstream iss;
btc_complexz;
iss.str(c.lit);
iss >> z;
if (z == c.val) {
cout << "test successful." << endl;
} else {
cout << "test failed: expected " << c.val << ", but got " << z << endl;
}
}
}
return 0;
}