On Mar 14, 2013, at 2:08 PM, kee nethery wrote:

> I would do the calc once.
> I would make the last one default just in case the calc provides you with 
> something funky.
> Kee
> 
> __put sin(pAngleInRadians) into sinCalc
> __switch
> ____case sinCalc > 0
> ______put 1 into tX
> ______break
> ____case sinCalc = 0
> ______put 0 into tX
> ______break
> ____default
> ______put -1 into tX
> ______break
> __end switch

And combining the suggestions, you could do:

put sin(pAngleInRadians) into sinCalc
switch sinCalc
   case 0
      put 0 into tX
      break
   default
      put sinCalc/abs(sinCalc) into tX
end switch

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to