Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Ruby | Random new_seed() function

  • Last Updated : 17 Dec, 2019

Random#new_seed() : new_seed() is a Random class method which returns a random seed value.

Syntax: Random.new_seed()

Parameter: Random values

Return: a random seed value

Example #1 :




# Ruby code for Random.new_seed() method
  
# declaring Random value
date_a = Random.new_seed()
  
# new arbitrary random value
puts "Random new_seed form : #{date_a}\n\n"

Output :

Random new_seed form : 136900168362527727761982174954109934532

Example #2 :




# Ruby code for Random.new_seed() method
  
# declaring Random value
date_b = Random.new_seed()
  
# new arbitrary random value
puts "Random new_seed form : #{date_b}\n\n"

Output :

Random new_seed form : 271255499858368204233299869842415724010

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!