Copy link to clipboard
Copied
Hi everybody!
This is either going to be "oh duh" or "oh god"... I just came back from a holiday. 🙂
While multiplying numbers, I'm sometimes getting "close" but wrong results.
Does anybody have experience with that?
See how 190*2.379 should be 452.01 and not 454.389?
This is the cleaned up code (I changed the numbers for readability)
var theThing = { x:100,
y:200,
w:300,
h:400,
gravity:{ x:100,
y:200
}
};
var ratio = 2.379;
theThing.x *= ratio;
theThing.y *= ratio;
theThing.w *= ratio;
theThing.h *= ratio;
theThing.gravity.x *= ratio;
theThing.gravity.y *= ratio;
The data types are "number" not string (checked it)
Does anybody have any suggestion/lead/tip/link/pill?
Thanks a lot! ❤️
Copy link to clipboard
Copied
Hello? Is there anybody out there?
Just nod if you can hear me...
Copy link to clipboard
Copied
They're probably all just comfortably numb 😉
Copy link to clipboard
Copied
Goddammit! 😄
Your lips move but I can't hear what you're saying!
Copy link to clipboard
Copied
I'll need some information first
Just the basic facts
Copy link to clipboard
Copied
alert (Number(190*2.379))
poduces
for me.
Copy link to clipboard
Copied
More for myself than anything else...
That image, and only that image, has a different size than all others in the collection I'm using for testing.
Key takeaway:
Before you throw an adobe at the wall, check your media as well as your script!
FML.
❤️