|
Ever Student
Registered User
Join date: 18 Oct 2006
Posts: 7
|
11-10-2006 07:33
I hope this is the right forum for this, this is my first post.
Unless I'm losing my mind, there's something drastically wrong with the arithmetic of SL's scripts. I've tried to boil it down as simply as possible, and it appears that according to SL, (-5+24-1) is 19. In fact, if you ask it, 19-1 is also 19! I'll cut and paste the code and response, just in case I'm completely losing it and misreading something:
llOwnerSay("19-1 = "+ (string)(19-1));
Response: 19-1 = 19
It doesn't seem to be a weirdness of conversion to string either, because it affects further calculations.
Please, someone has to check into this. If there's no problem, I'm sorry for sounding so rattled, but you have to admit that seeing a response like the one above is going to make you really puzzled.
|
|
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
|
11-10-2006 07:48
Try putting spaces in the equation.
For example, instead of "9-1", try "9 - 1".
|
|
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
|
11-10-2006 07:53
Shack is probably correct.
This is a very common problem with source code parsers, and is not always a trivial fix... Sometimes it's harder than you'd think for the compiler to determine the meaning of the '-' character in an equation such as yours that does not contain spaces on either side of that character.
The LSL compiler, while adequate and I'm glad we have it, contains many such issues.
|
|
Aerial9 Soothsayer
Registered User
Join date: 21 Oct 2005
Posts: 10
|
I agree
11-12-2006 18:27
yeah try spacing out cause is if I get it right what you may be asking is 19negative1 (19-1)
|
|
Ever Student
Registered User
Join date: 18 Oct 2006
Posts: 7
|
11-12-2006 20:06
Yeah, adding the spaces seems to have done the trick. Thanks guys!
Just really disconcerting when something like that happens...
|