Go Back   Winamp Forums > Skinning and Design > Modern Skins

Reply
Thread Tools Search this Thread Display Modes
Old 15th June 2002, 02:31   #1
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
Absolute screamer of a MAKI floating point bug ...

This one has *really* annoyed me, as it's effectively going to stop development on my generalised curved volume slider script until it's fixed.

code:


System.onScriptLoaded () {

messageBox ("started", "", 0, "");

Float f1 = 10;
messageBox (floatToString (f1, 10), "", 0, "");
Float f2 = 20;
messageBox (floatToString (f2, 10), "", 0, "");
Float f3 = (f1*f1 - f2*f2);
messageBox (floatToString (f3, 10), "", 0, "");
Float f4 = 1 / f3;
messageBox (floatToString (f4, 10), "", 0, "");

messageBox ("success!", "", 0, "");

}




Winamp beta 3 crashes when it attempts to evaluate f4 (and no, before you ask, it isn't a division-by-zero). I've not tried it with the other builds yet, but it's seriously in need of a fix. I mean, adding poncey new Rectangle classes to the new builds is all very well, but when your floating-point code contains a flaw like this, I reckon a bit more work needs to be done on the core language.

Can someone else *please* compile this and see what happens to them ?

DJG (furious)
DJGrenola is offline   Reply With Quote
Old 15th June 2002, 02:41   #2
thepyr0x
Major Dude
 
thepyr0x's Avatar
 
Join Date: Oct 2001
Location: At my house in a city in Canada
Posts: 1,336
Re: Absolute screamer of a MAKI floating point bug ...

Quote:
Originally posted by DJGrenola
code:


System.onScriptLoaded () {

messageBox ("started", "", 0, "");

Float f1 = 10;
messageBox (floatToString (f1, 10), "", 0, "");
Float f2 = 20;
messageBox (floatToString (f2, 10), "", 0, "");
Float f3 = (f1*f1 - f2*f2);
messageBox (floatToString (f3, 10), "", 0, "");
Float f4 = 1 / f3;
messageBox (floatToString (f4, 10), "", 0, "");

messageBox ("success!", "", 0, "");

}

now I'm no scripting guru; but shouldnt it go
code:
Float f4 = (1 / f3);

??
try that see if it works

thepyr0x is offline   Reply With Quote
Old 15th June 2002, 02:57   #3
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
the plot thickens

That didn't seem to help, but I found something which did: the floating point code itself is fine, but it seems to be the message boxes which are causing it to crash. I dunno whether there's a bug in the floatToString() method, or whether it's just something wrong with the messageboxes, but removing the debugging code seems to do the trick. Which is a bit bizarre. Shrug.

DJG
DJGrenola is offline   Reply With Quote
Old 15th June 2002, 03:07   #4
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
floatToString()

Yeah, it seems to be the floatToString() method. This:

code:


Float f1 = 10;
Float f2 = 20;
Float f3 = (f1*f1 - f2*f2);
Float f4 = (1 / f3);
String s = floatToString(f4, 10);




crashes it, but this:

code:


Float f1 = 10;
Float f2 = 20;
Float f3 = (f1*f1 - f2*f2);
Float f4 = (1 / f3);




... seems fine.

DJG
DJGrenola is offline   Reply With Quote
Old 15th June 2002, 10:26   #5
spleen
Senior Member
 
spleen's Avatar
 
Join Date: Feb 2002
Location: Split, Croatia
Posts: 180
Send a message via ICQ to spleen
Yes, floatToString() method chashes Beta 3 in some cases.
Don't know which ones, but it has a bug that chrashes Wa3.
I think that it is fixed in later developer releases.
spleen is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump