word_max_value

Downloadword_max_value(length,size)   Returns the largest unsigned integer that can be stored in the given number of words of the given size.
/*
**  Usage:
**      word_max_value(length,size)
**
**  Arguments:
**      length      number of words, positive integer
**      size        size of the word in bits, positive integer (optional)
**
**  Returns:
**      the largest unsigned integer that can be stored
**      in the given number of words of the given size,
**      if no size is given, words are treated as bits
**
**  Example:
**      word_max_value(1,8) ==  255
**      word_max_value(2)   ==  3
**
**  GMLscripts.com
*/

{
    return (1 << (argument0*max(1,argument1)))-1;
}

Click if you've used this script[Please Login]
Projects: 2


comments powered by Disqus