-
Notifications
You must be signed in to change notification settings - Fork 64
toString() Test is more strict than spec for Float32x4. #295
Comments
What would be the purpose of providing the precision? I would expect the spec to dictate standard JavaScript string representations for numbers. When would that not be desirable? |
I agree that using Number.prototype.ToString() is the right answer, and after a closer look at the spec, I think that's the intent:
However,
|
Remember that they may be Booleans. It's true that the spec is unclear; I was imagining that the semantics would be like |
Simply calling the abstract operation |
Yes. I think just adding a note under [[SIMDElements]] definition indicating that values are either Number or Booleans depending on the SIMDTypeDescriptor should be enough. I will submit a PR. |
Currently, we verify correctness by strict string comparison, causing failures due to subtle difference in formatting or precision (e.g. "SIMD.Float32x4(1.0, 2.0, 3.0, 4.0)" !== "SIMD.Float32x4(1, 2, 3, 4)"). The spec doesn't dictate specific formatting on lane values.
Better to do CheckValue(.., v, eval(v.toString()), assuming NaNs and Infinities are not tested ?
The text was updated successfully, but these errors were encountered: