WoW BlueTracker Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
Poster: Sli at 7/12/2005 1:43:34 AM PDT
Subject: Warning: SavedVariables rounds numbers!
   Although Lua numbers are stored internally as double-precision reals, when they are saved in SavedVariables.lua, they get rounded to single-precision reals! This means that you only get about 6 digits of precision, even for integer values.

I found this out the hard way when trying to figure out why time() values would work fine until I relogged. I kept getting timed events that were way off. I finally noticed that all the time() values were getting rounded off. These are 10-digit numbers, so after reloading, the last 4 digits get set to 0! This means that timestamps can be off by over an hour!

The solution is to store it as a string with tostring() and reload it with tonumber(), but it can be a pain to mess with if you aren't careful.

[ post edited by Sli ]

  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=178684&p=#post178684
 
Poster: slouken at 7/12/2005 10:09:25 AM PDT
Subject: Re: Warning: SavedVariables rounds numbers!
   This will be fixed in 1.7, thanks!
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=178684&p=#post178727

View all recent official Blue Posts

WoW Blue Tracker: Archiving World of Warcraft Blue Posts
since March 2005
Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
 

Why Ads?