| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Kernel/ |
Upload File : |
U:RDoc::AnyMethod[iI" rand:ETI"Kernel#rand;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"KIf called without an argument, or if <tt>max.to_i.abs == 0</tt>, rand ;TI"Hreturns a pseudo-random floating point number between 0.0 and 1.0, ;TI"%including 0.0 and excluding 1.0.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"(rand #=> 0.2725926052826416 ;T:@format0o; ; [I"RWhen +max.abs+ is greater than or equal to 1, +rand+ returns a pseudo-random ;TI"Einteger greater than or equal to 0 and less than +max.to_i.abs+.;T@o;; [I"rand(100) #=> 12 ;T; 0o; ; [I"AWhen +max+ is a Range, +rand+ returns a random number where ;TI"#range.member?(number) == true.;T@o; ; [I"KNegative or floating point values for +max+ are allowed, but may give ;TI"surprising results.;T@o;; [I"rand(-100) # => 87 ;TI"(rand(-0.5) # => 0.8130921818028143 ;TI";rand(1.9) # equivalent to rand(1), which is always 0 ;T; 0o; ; [I"MKernel.srand may be used to ensure that sequences of random numbers are ;TI"6reproducible between different runs of a program.;T@o; ; [I"See also Random.rand.;T: @fileI" random.c;T:0@omit_headings_from_table_of_contents_below0I"rand(max=0) -> number ;T0[ I"(*args);T@/FI"Kernel;TcRDoc::NormalModule00