I'm using the Ammo.js physics library (https://github.com/kripken/ammo.js/)
Here's an example of the problem:
const a = [-0.0000064798259700182825, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
const t = new Ammo.btTransform();
t.setIdentity();
const q = new Ammo.btQuaternion(a[0], a[1], a[2], a[3])
t.setRotation(q)
const r = t.getRotation()
assert(a[0] === r.x()) // fails here as r.x() === -0.000006479827334260335
assert(a[1] === r.y())
assert(a[2] === r.z())
assert(a[3] === r.w())
I was expecting to get the same values for the rotation as I had set, but didn't get them. I've also tried normalizing the quaternion first, but that was not the problem. Any advice would be much appreciated!