Hey guys,
 
last week I asked about a better way of getting hex values and R.B. told me about src\lib\dynapi\ext\functions.js (thank you for the tip :).
 
this was the function I wanted:
 
 DecToHex : function(val)
{
  lo=val%16
  val-=lo
  lo+=48
  if (lo>57) lo+=7
  hi=val/16
  hi+=48
  if (hi>57) hi+=7
  return String.fromCharCode(hi,lo)
 }
 
now after a little research I've found the toString() method but Im not sure about which is better, actually I got this function:
 
function DecToHex(w)
    {
        return (w < 16)? '0' + w.toString(16) : w.toString(16);
    }
 
So I want to know which is better, I mean speed, resources...
theres something about that method Im should know??
Im trying to learn about javascript behavior, I've had some experience with it; but there are some issues that Im still not sure about them.
Example:
    is x >> 4 faster than x / 16?? (as in C)
is there a document somewhere I should read??
 
Ok, thats my question :)
I know this is not a DynAPI issue; but DynAPI is one of the better "nice coded" scripts I've found!!
thank you all.

Reply via email to