What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to check the Plus! version

Pages: (2): « First [ 1 ] 2 » Last »
How to check the Plus! version
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
O.P. How to check the Plus! version
Original Subject: "dodgy bug in scripting"

With the current version (4.10.250), MsgPlus.Version returns 4.099999904632568, which is not equal to 4.10. I was wondering why this code didn't work as i expected
code:
if (MsgPlus.Version < 4.10) {
    Debug.Trace("You have an old version of Plus");
}
and I was surprised when I did "Debug.Trace(MsgPlus.Version);" and i showed 4.099999904632568. :O

This post was edited on 01-13-2007 at 08:31 AM by WDZ.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
11-12-2006 11:05 AM
Profile PM Find Quote Report
NiteMare
Veteran Member
*****

Avatar
Giga-Byte me

Posts: 2497
Reputation: 37
37 / Male / Flag
Joined: Aug 2003
RE: dodgy bug in scripting
confirmed, i got 4.09999990463257
[Image: sig/]
I'll never forget what she said 6860 days, 20 hours, 58 minutes, 55 seconds ago
Need hosting? Check
out my website. we can help you out :)
11-12-2006 11:59 AM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: dodgy bug in scripting
Always use epsilon comparison (or something like that) when comparing floating-point numbers.

Well, at least that's what I do when I code in C/C++... :p


But I think this can be fixed though...causing confusion for basic scripters.

This post was edited on 11-12-2006 at 12:03 PM by Mnjul.
11-12-2006 12:00 PM
Profile PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
O.P. RE: dodgy bug in scripting
quote:
Originally posted by Mnjul
Always use epsilon comparison (or something like that) when comparing floating-point numbers.
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:
Originally posted by Mnjul
But I think this can be fixed though...causing confusion for basic scripters.
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.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
11-12-2006 12:10 PM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: dodgy bug in scripting
Fixed... nothing annoys me more than the stupid floating point data types of C++...
[Image: signature2.gif]
11-15-2006 04:54 AM
Profile PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
O.P. RE: dodgy bug in scripting
quote:
Originally posted by Plus' changelog
Scripts MsgPlus.Version returns a more usable floating point value (see update in documentation).
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 :P... 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 :P

This post was edited on 11-16-2006 at 08:36 PM by Choli.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
11-16-2006 08:36 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: dodgy bug in scripting
while playing with it (and reading up on som IEEE docs) I found:
http://babbage.cs.qc.edu/IEEE-754/Decimal.html

dunno how representative or usefull this is. Seems like single precision doesn't yield the accurate result, double precision does.

This post was edited on 11-17-2006 at 02:00 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-17-2006 01:59 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: dodgy bug in scripting
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.

If you want a fixed integer, you already have it: the build number :).
[Image: signature2.gif]
11-17-2006 07:07 AM
Profile PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
O.P. RE: dodgy bug in scripting
quote:
Originally posted by CookieRevised
Seems like single precision doesn't yield the accurate result, double precision does.
4.1 is a periodic number in base 2, it doesn't matter if you choose single or double precission
quote:
Originally posted by Patchou

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.
it's ok with that (Y)
quote:
Originally posted by Patchou
If you want a fixed integer, you already have it: the build number
<picky mode>
i can't use the build number:
quote:
Originally posted by scripts documentation
For safety reasons, the build number should always be paired with the major/minor version number of Messenger Plus!. Build numbers are not guaranteed to stay sequential between two new major versions of Messenger Plus!.
just being picky :P
</picky mode>
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
11-17-2006 10:07 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: dodgy bug in scripting
Just check if its version 4 or 5 and you'll be ok with the build number :)

This post was edited on 11-17-2006 at 06:28 PM by Patchou.
[Image: signature2.gif]
11-17-2006 06:25 PM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On