Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random number without rand function

/** * Implementation of XorShift * algorithm in JavaScript */
var seed;

function xorShift(){

  seed ^= seed << 13;

  seed ^= seed >> 17;

  seed ^= seed << 5;

  return seed;
}
Source by svijaykoushik.github.io #
 
PREVIOUS NEXT
Tagged: #random #number #rand #function
ADD COMMENT
Topic
Name
4+3 =