Modulo in the web idl spec

Hi,

Marcos Caceres seemed quite confused about the modulo used in the web idl spec. I said him that he could use the % symbol of ECMAScript to perform the operation even if that was not a true modulo, because this is what the spec seems to imply. Can you confirm me it is indeed the case?

Right now, I must admit I'm a bit confused too because I ran the following test in all modern browsers (Chrome Canary, Aurora, Opera Snapshots and IE10) and it returned the result I would expect from a true modulo, not from the JS one:

>> t = new ArrayBuffer(1) 
>> v = new DataView(t) 
>> v.setUint8(0,-1) 
>> v.getUint8(0) 
255 

It would probably be good to actually clarify which modulo is actually used by browsers and use that one in the spec?

Best regards,
François

[PS] The definition of setUint8 is as follows:
---------------------------------------------------------------
void setUint8(unsigned long byteOffset, octet value);
--------------------------------------------------------------- 		 	   		  

Received on Monday, 14 January 2013 18:25:21 UTC