Subj : Re: -x when x == 0 treated as a double ? To : netscape.public.mozilla.jseng From : Mike Shaver Date : Wed Jan 26 2005 12:40 pm bubbfree@gmail.com wrote: > I have some unexpected behavior in SpiderMonkey (latest RC6). If I do > this: > > var x = 0; > myNativeFunction(-x); > > the jsval in argv[0] for my native handler is of type double. I would > have expected int. I think double is correct there. Spidermonkey will express a number internally as an int jsval only if the transformation is exact. Since there's no integer representation with jsvals for -0, IIRC, it will always be a double. Mike .