[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04078] Re: unpack and "bn" with n>16

From: ARIMA Yasuhiro <fit0298@...>
Date: 2000-07-17 11:58:47 UTC
List: ruby-talk #4078
Hi.

Pixel <pixel@mandrakesoft.com> wrote

| There must be a good reason for the following (tested on 1.4.5, 1.4.3,
| ix86/axp):
| 
| p "\0\0\0\0".unpack("b16b1b2") # -> ["0000000000000000", "0", "00"]
| p "\0\0\0\0".unpack("b17b1b1") # -> ["00000000000000000", "0", ""]
| 
| I can't find it though :(

I try it, and modified a little.

p "\0\377\0\377".unpack("b16b1b2") # -> ["0000000011111111", "0", "11"]
p "\0\377\0\377".unpack("b17b1b1") # -> ["00000000111111110", "1", ""]

--
  /)/)   ARIMA Yasuhiro
 (^-^)   fit0298@fitec.co.jp
 (0 0)o  

In This Thread

Prev Next