How to check the Plus! version - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: How to check the Plus! version (/showthread.php?tid=68347) How to check the Plus! version by Choli on 11-12-2006 at 11:05 AM
Original Subject: "dodgy bug in scripting" code:and I was surprised when I did "Debug.Trace(MsgPlus.Version);" and i showed 4.099999904632568. RE: dodgy bug in scripting by NiteMare on 11-12-2006 at 11:59 AM confirmed, i got 4.09999990463257 RE: dodgy bug in scripting by Mnjul on 11-12-2006 at 12:00 PM
Always use epsilon comparison (or something like that) when comparing floating-point numbers. But I think this can be fixed though...causing confusion for basic scripters. RE: dodgy bug in scripting by Choli on 11-12-2006 at 12:10 PM
quote:if in my code, that number (4.0999...etc) is not equal to 4.10, that means that 4.10 - 4.0999... is bigger than epsilon, so even if i've used epsilon, the comparision would have been different. quote:yes, of course; and not only for basic developers. For me its a pain to calculate, for each new version of plus, which is the value returned by msgplus.version... and not to mention that that value seem to be diferent depending on ... on what? NiteMare's Plus returns a value diferent from mine. RE: dodgy bug in scripting by Patchou on 11-15-2006 at 04:54 AM Fixed... nothing annoys me more than the stupid floating point data types of C++... RE: dodgy bug in scripting by Choli on 11-16-2006 at 08:36 PM
quote:Well, in fact MsgPlus.Version returns a more usable value... for me it returns now 4.101010322570801, which in my code it works ok, but it still may fail, if you compare with ">" instead with "<" (because 4.101010322570801 is not the same as 4.10). ok, ok... i'm being picky ... if I had to choose, i'd choose 4.101010322570801 (like it's now) instead of 4.099999904632568 (like before). but maybe MsgPlus.Version could return an integer..., couldn't it? What about returning 4100 or 4010? That would make no confusion. I know, that changing the type (and value) of the returned number will cause backwards incompatibilities, but IMO, returning an integer would be the best option. on the other hand, in the changelog, Patchou, you talk about a new documentation... where can we download it from? ... i know i should have read it before posting, maybe in the documentation there's something I haven't noticed RE: dodgy bug in scripting by CookieRevised on 11-17-2006 at 01:59 AM
while playing with it (and reading up on som IEEE docs) I found: RE: dodgy bug in scripting by Patchou on 11-17-2006 at 07:07 AM
The documentation will be updated with an indication that the equal operator should not be used, instead, use "more than" or "less than". The change is that you'Re now guarenteed that the value returned will always be slighly above the exact version number, I can't do any better than that. RE: dodgy bug in scripting by Choli on 11-17-2006 at 10:07 AM
quote:4.1 is a periodic number in base 2, it doesn't matter if you choose single or double precission quote:it's ok with that quote:<picky mode> i can't use the build number: quote:just being picky </picky mode> RE: dodgy bug in scripting by Patchou on 11-17-2006 at 06:25 PM Just check if its version 4 or 5 and you'll be ok with the build number RE: dodgy bug in scripting by CookieRevised on 11-17-2006 at 10:00 PM
quote:That page I linked to does tell/show it makes a big difference though (also the docs I've read on it -quickly- say it does) :/ .... --------------------- EDIT: - Requested thread to be moved to public scripting forum. - For those who whish to check versions, use something like this to avoid the floating point trap and to have an as accurate as possible build check: code:Where nSoftwareBuild is a number in the form of 4244, 4250, 5398, etc... This is the exact same method used by Plus! itself to check for updates and stuff. And since the major version number and build number will always uniquely define the installed version (the minor version number doesn't matter). The function will return true if the user's version is equal or higher than the requested softwarebuild. |