35 static const WCHAR toLocaleStringW[] = {
't',
'o',
'L',
'o',
'c',
'a',
'l',
'e',
'S',
't',
'r',
'i',
'n',
'g',0};
37 static const WCHAR toExponentialW[] = {
't',
'o',
'E',
'x',
'p',
'o',
'n',
'e',
'n',
't',
'i',
'a',
'l',0};
38 static 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;
313 val *=
pow(radix, -log_radix);
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 const WCHAR NumberW[]
static jsstr_t * jsstr_alloc(const WCHAR *str)
HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
#define memmove(s1, s2, n)
HRESULT throw_range_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
static const WCHAR toPrecisionW[]
static HRESULT Number_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const WCHAR toStringW[]
GLdouble GLdouble GLdouble r
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)
static NumberInstance * number_from_vdisp(vdisp_t *vdisp)
static NumberInstance * number_from_jsdisp(jsdisp_t *jsdisp)
static void jsstr_release(jsstr_t *str)
static HRESULT Number_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
static void number_to_str(double d, WCHAR *buf, int size, int *dec_point)
GLsizei GLsizei GLuint * obj
GLenum GLuint GLenum GLsizei const GLchar * buf
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
static NumberInstance * number_this(vdisp_t *jsthis)
float pow(float __x, int __y)
static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static size_t double number
static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT to_string(VARIANT *src, BSTR *dst)
#define JS_E_PRECISION_OUT_OF_RANGE
HRESULT to_int32(script_ctx_t *, jsval_t, INT *) DECLSPEC_HIDDEN
static jsval_t jsval_string(jsstr_t *str)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
_Check_return_ double __cdecl fmod(_In_ double x, _In_ double y)
static HRESULT alloc_number(script_ctx_t *ctx, jsdisp_t *object_prototype, NumberInstance **ret)
static jsstr_t * number_to_fixed(double val, int prec)
static const builtin_info_t NumberInst_info
static BOOL is_vclass(vdisp_t *vdisp, jsclass_t class)
_STLP_DECLSPEC complex< float > _STLP_CALL log10(const complex< float > &)
static const WCHAR toExponentialW[]
static HRESULT Number_toPrecision(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 const builtin_prop_t Number_props[]
HRESULT create_number(script_ctx_t *ctx, double value, jsdisp_t **ret)
GLsizei const GLfloat * value
#define NUMBER_TOSTRING_BUF_SIZE
BOOL is_finite(double) DECLSPEC_HIDDEN
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 const builtin_info_t Number_info
#define JS_E_NUMBER_EXPECTED
static const WCHAR toFixedW[]
static void jsdisp_release(jsdisp_t *jsdisp)
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
static jsval_t jsval_obj(jsdisp_t *obj)
static const WCHAR toLocaleStringW[]
jsstr_t * jsstr_alloc_buf(unsigned len, WCHAR **buf)
#define JS_E_FRACTION_DIGITS_OUT_OF_RANGE
HRESULT throw_type_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
static const WCHAR valueOfW[]
WINE_DEFAULT_DEBUG_CHANNEL(jscript)
_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)
static jsstr_t * number_to_exponential(double val, int prec)
static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static jsval_t jsval_number(double n)
static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static BOOL heap_free(void *mem)