0

The following implementation of Skip32 for java produces signed int(Skip32 impementation).

Is there way to modify it so that only positive numbers are generated ?

Or can one use the absolute value of the int generated(without worrying about duplicity ) ?

Manas Pratim Chamuah
  • 1,527
  • 2
  • 15
  • 33
  • 1
    Is zero allowed, or do you only want to allow _strictly_ positive numbers? – Louis Wasserman Jun 08 '20 at 19:10
  • @LouisWasserman i want strictly positive numbers as i want to use them as reference id – Manas Pratim Chamuah Jun 08 '20 at 19:31
  • The simplest way to make the output positive is to store it in a long, e.g. `long val = skip32(x) & 0xffffffffL;` Note that skip32 is a *permutation*. It maps a 32-bit input into a 32-bit output such that skip32(x) = skip32(y) if and only if x = y. It is not at all clear what your input to this function is. – President James K. Polk Jun 08 '20 at 20:13

0 Answers0