Debugging Random Function in C: Generates Only "3

  • Thread starter Thread starter sandy.bridge
  • Start date Start date
  • Tags Tags
    Function Random
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
31 replies · 5K views
sandy.bridge said:
It seems that it isn't returning the ith repeat.

You should still remove the first call to random(k) in your main() function.
It obfuscates the results.
 
Physics news on Phys.org
Thanks! I had that out before but I must have opened the wrong one. Eventually I will get this random function down pat!