Hi,

Am Donnerstag, 17. Dez 2009, 22:57:30 +0900 schrieb Nicolas Vincent:
> Here's an example :
> BigNum stored in the database : 3232235797
> Resulting IP : 192.168.1.21

Here's one without using pack/unpack:

  ip = 3232235797
  a = []
  4.times { a.unshift ip & 0xff ; ip >>= 8 }
  a.join "."
  #=> "192.168.1.21"

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
*
Discover String#notempty? at <http://raa.ruby-lang.org/project/step>.