millermedeiros/amd-utils — Issue #17: ToUInt and ToUInt32 behavior
Author: millermedeiros
Created: 2011-11-24 15:58:34+00:00
State: open
Labels: question

right now if `val < 0` it will return `0`, I'm not sure if that is the right behavior.

In AS3 calling `uint(-1.5)` will return `4294967295`.

According to the [ES5 spec](http://es5.github.com/#x9.6) `ToUint32(-1.5)` will return `1`

3 possible behaviors:

1. if `val < 0` return 0 (current);
2. do `Math.abs(val) >>> 0` (same behavior as ES5 ToUint32);
3. do `val >>> 0` (same as AS3);

[see this comment for more details](https://github.com/kriskowal/es5-shim/issues/78#issuecomment-2866000).