Пример #1
0
double
wcstod(const wchar_t *cp, wchar_t **ptr)
{
	double		x;
	decimal_mode	mr;
	decimal_record	dr;
	fp_exception_field_type fs;
	int 		form;

	wstring_to_decimal(&cp, __xpg6 & _C99SUSv3_recognize_hexfp, &dr, &form);
	if (ptr != NULL)
		*ptr = (wchar_t *)cp;
	if (form == 0)
		return (0.0);	/* Shameful kluge for SVID's sake. */
#if defined(__i386) || defined(__amd64)
	mr.rd = __xgetRD();
#elif defined(__sparc)
	mr.rd = _QgetRD();
#else
#error Unknown architecture!
#endif
	if (form < 0)
		__hex_to_double(&dr, mr.rd, &x, &fs);
	else
		decimal_to_double(&x, &mr, &dr, &fs);
	if (fs & ((1 << fp_overflow) | (1 << fp_underflow)))
		errno = ERANGE;
	return (x);
}
Пример #2
0
	HashValue SendToAddress(RCString address, decimal64 amount, RCString comment) override {
		return HashValue(Call("sendtoaddress", address, decimal_to_double(amount), comment).ToString());
	}