Thread Tools Display Modes
07-20-17, 12:22 AM   #1
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
Comparing numbers bug

Not sure if its a bug. In my mod i'm comparing values stored in a table. And I found things like value > 1.9 would return true if value = 1.9. The weird this is this returns false right after a reload UI. But then if I shift the number down to 1.8 then back to 1.9, it thinks 1.9 is greater than 1.9.

The fix was to compare against 1.901. My only guess is lua treats everything as float internally and I know comparing floats can give back inaccurate results.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Comparing numbers bug


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off