[Opensim-users] Simple lsl bug with dramatic effect

Dr Ramesh Ramloll r.ramloll at gmail.com
Wed May 8 14:16:33 UTC 2013


Hello,
I am sharing on this list hoping that some brains could help me figure this
one out. I think I have hit a modulus divisor bug. Please let me know what
you think. This had a significant impact on my scripts ... the whole thing
froze after I made a simple change to a single variable and am wondering if
I have hit some constraints that I am not aware of. Basically I am trying
to pass parameters to a rezzed child object (see below). I generate values
at the parent prim and try to get those values back from the rezzed child.
Any thoughts appreciated.
Thank you.

integer commChannel =54;
integer modulus_divisor = 1000000000;
integer objectPinIndex = 23;
integer rezParameter;
integer repro_commChannel;
integer repro_objectPinIndex;

default
{
    state_entry()
    {
        rezParameter = -1*((commChannel*modulus_divisor)+(objectPinIndex));
        repro_commChannel = -1*((integer)rezParameter)/modulus_divisor;
        repro_objectPinIndex = -1*((integer)rezParameter)%modulus_divisor;

        llOwnerSay("modulus="+(string)modulus_divisor);
        llOwnerSay("objectPinIndex="+(string)objectPinIndex);
        llOwnerSay("commChannel="+(string)commChannel);
        llOwnerSay("REPRODUCING VALUES");
        llOwnerSay("repro_objectPinIndex="+(string)repro_objectPinIndex);
        llOwnerSay("repro_commChannel="+(string)repro_commChannel);
    }


}

output follows:

modulus=100000000 (eight zeroes)
[06:57] Primitive: modulus=100000000
[06:57] Primitive: objectPinIndex=23
[06:57] Primitive: commChannel=54
[06:57] Primitive: REPRODUCING VALUES
[06:57] Primitive: repro_objectPinIndex=5032727
[06:57] Primitive: repro_commChannel=11



now change modulus = 10000000

output is:

Primitive: modulus=10000000 (seven zeroes)
[06:56] Primitive: objectPinIndex=23
[06:56] Primitive: commChannel=54
[06:56] Primitive: REPRODUCING VALUES
[06:56] Primitive: repro_objectPinIndex=23
[06:56] Primitive: repro_commChannel=54


also, modulus_divisor = 29999999 works
modulus_divisor = 39699999 also works; this appears to be the experimental
upper bound before modulus_divisor stops working.
I did not expect this.

-- 
'Consider how the lilies grow. They do not labor or spin.'
*Rameshsharma Ramloll* PhD, CEO CTO DeepSemaphore LLC, Affiliate *Research
Associate Professor*, Idaho State University, Pocatello, ID 83209 Tel:
208-240-0040
Blog <http://deepsemaphore.posterous.com/>,
LinkedIn<http://www.linkedin.com/in/rameshramloll>
, DeepSemaphore LLC <http://www.deepsemaphore.com>, Google+
profile<https://plus.google.com/103652369558830540272/about>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20130508/4dbdf9ba/attachment.html>


More information about the Opensim-users mailing list