35static const WCHAR toLocaleStringW[] = {
't',
'o',
'L',
'o',
'c',
'a',
'l',
'e',
'S',
't',
'r',
'i',
'n',
'g',0};
37static const WCHAR toExponentialW[] = {
't',
'o',
'E',
'x',
'p',
'o',
'n',
'e',
'n',
't',
'i',
'a',
'l',0};
38static const WCHAR toPrecisionW[] = {
't',
'o',
'P',
'r',
'e',
'c',
'i',
's',
'i',
'o',
'n',0};
41#define NUMBER_TOSTRING_BUF_SIZE 64
42#define NUMBER_DTOA_SIZE 18
89 }
else if(
buf[0]==
'0' &&
buf[1]>=
'1' &&
buf[1]<=
'9') {
99 int dec_point,
size, buf_size, buf_pos;
114 buf_size = prec ? prec+1 : 2;
138 for(;buf_pos<buf_size-1 && dec_point; dec_point--)
143 for(; dec_point>0; dec_point--)
148 for(; dec_point<0 && prec; dec_point++, prec--)
150 for(; buf_pos<buf_size-1 && prec; prec--)
152 for(; prec; prec--) {
163 int dec_point,
size, buf_size, exp_size = 1;
179 for(; buf_size>1 &&
buf[buf_size-1]==
'0'; buf_size--)
183 while(dec_point>=
size || dec_point<=-
size) {
189 size = buf_size+2+exp_size;
191 size = buf_size+3+exp_size;
193 size = prec+4+exp_size;
210 for(; prec>buf_size-1; prec--)
218 dec_point = -dec_point;
222 str[--
size] =
'0'+dec_point%10;
251 if(radix<2 || radix>36)
287 INT beg =
buf[0]==
'-'?1:0;
311 idx = (
buf[0]==
'-') ? 1 : 0;
327 static const WCHAR formatW[] = {
'(',
'e',
'%',
'c',
'%',
'd',
')',0};
331 log_radix = -log_radix;
378 if(prec<0 || prec>20)
419 if(prec<0 || prec>20)
460 if(prec<1 || prec>21)
565 case DISPATCH_CONSTRUCT: {
618 static const WCHAR NumberW[] = {
'N',
'u',
'm',
'b',
'e',
'r',0};
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
HRESULT throw_type_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
HRESULT throw_range_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
HRESULT create_builtin_constructor(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, const builtin_info_t *builtin_info, DWORD flags, jsdisp_t *prototype, jsdisp_t **ret)
double pow(double x, double y)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static HRESULT to_string(VARIANT *src, BSTR *dst)
_Check_return_ double __cdecl fmod(_In_ double x, _In_ double y)
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *constr)
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
static const WCHAR NumberW[]
static BOOL is_vclass(vdisp_t *vdisp, jsclass_t class)
#define JS_E_PRECISION_OUT_OF_RANGE
static void jsdisp_release(jsdisp_t *jsdisp)
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
HRESULT to_int32(script_ctx_t *, jsval_t, INT *) DECLSPEC_HIDDEN
#define JS_E_NUMBER_EXPECTED
BOOL is_finite(double) DECLSPEC_HIDDEN
#define JS_E_FRACTION_DIGITS_OUT_OF_RANGE
jsstr_t * jsstr_alloc_buf(unsigned len, WCHAR **buf)
static void jsstr_release(jsstr_t *str)
static jsstr_t * jsstr_alloc(const WCHAR *str)
static jsval_t jsval_string(jsstr_t *str)
static jsval_t jsval_obj(jsdisp_t *obj)
static jsval_t jsval_number(double n)
#define memmove(s1, s2, n)
static unsigned int number
static const WCHAR toPrecisionW[]
static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static NumberInstance * number_this(vdisp_t *jsthis)
static const WCHAR valueOfW[]
static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
static const builtin_info_t NumberInst_info
static NumberInstance * number_from_vdisp(vdisp_t *vdisp)
static const builtin_info_t Number_info
static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const WCHAR toLocaleStringW[]
static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_number(script_ctx_t *ctx, double value, jsdisp_t **ret)
static HRESULT Number_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT alloc_number(script_ctx_t *ctx, jsdisp_t *object_prototype, NumberInstance **ret)
static NumberInstance * number_from_jsdisp(jsdisp_t *jsdisp)
static const WCHAR toStringW[]
static const WCHAR toFixedW[]
#define NUMBER_TOSTRING_BUF_SIZE
static const WCHAR toExponentialW[]
static jsstr_t * number_to_exponential(double val, int prec)
static HRESULT Number_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
static jsstr_t * number_to_fixed(double val, int prec)
static void number_to_str(double d, WCHAR *buf, int size, int *dec_point)
static const builtin_prop_t Number_props[]
#define CONTAINING_RECORD(address, type, field)
size_t const unsigned const radix