Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [newbie] What means 1_000_000

Reply
Thread Tools

[newbie] What means 1_000_000

 
 
EdUarDo
Guest
Posts: n/a
 
      04-05-2006
Hi all,
trying ri and reading documentation for Benchmark I've seen an example
that says:

Benchmark.measure {"a"*1_000_000}

What's that literall? I've tried to do it with 1000000 instead of 1_000_000 and
it works too.

And what means the expression "a"*1000000? What do that?
 
Reply With Quote
 
 
 
 
Lutz Horn
Guest
Posts: n/a
 
      04-05-2006
EdUarDo <> writes:
> Benchmark.measure {"a"*1_000_000}
>
> What's that literall? I've tried to do it with 1000000 instead of
> 1_000_000 and it works too.


It *is* the same, only more friendly for human readers.

> And what means the expression "a"*1000000? What do that?


Why don't you just try it in irb?

irb(main):001:0> "a" * 10
=> "aaaaaaaaaa"

It's that simple

Regards
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIX public/24 ip static mapping means 256 times interfaces static maps? Nieuws Xs4all Cisco 2 05-26-2005 06:25 PM
PIX public/24 ip static mapping means 256 times interfaces static maps? Nieuws Xs4all Cisco 0 05-26-2005 11:07 AM
Link Light means what? JohnB Cisco 2 06-03-2004 09:51 PM
What does "fixup ftp STRICT" means in practice ? jarcar Cisco 1 12-05-2003 03:47 PM
What does .Net means? (abreviation) Rookie ASP .Net 4 08-20-2003 12:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57