LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate two different number

Solved!
Go to solution

Névtelen.png

0 Kudos
Message 11 of 19
(1,220 Views)

szabolcs,

 

That will not work per the requirements.  You can still get random numbers so that the top number is 1 and the bottom is 19 (playing the worst case.

 

Here is the solution I am recommending.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 19
(1,205 Views)

already made it.THX

0 Kudos
Message 13 of 19
(1,188 Views)

That will not guarantee that one number is greater than the other.  Although unlikely, it is possible that both values could be the same.

 

Lynn

0 Kudos
Message 14 of 19
(1,167 Views)

i expressed myself wrong .It's enough that the value isnt negative

0 Kudos
Message 15 of 19
(1,147 Views)

how can i generate such numbers where the two number's remainder is 0?always

0 Kudos
Message 16 of 19
(1,125 Views)

@szabolcs1295 wrote:

how can i generate such numbers where the two number's remainder is 0?always


I would generate two random numbers and then multiply them.  Take either of the original numbers and the multiplication result.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 17 of 19
(1,095 Views)

@szabolcs1295 wrote:

how can i generate such numbers where the two number's remainder is 0?always


Unless you are dealing with integers, you are entering dangerous territory here.

 

So far you said that the numbers should be positive. What is the upper limit? Are fractional numbers allowed? Are the random number supposed to have a uniform probability distribution?

0 Kudos
Message 18 of 19
(1,064 Views)

Apparently continued here. Please keep it all in one place!

0 Kudos
Message 19 of 19
(1,044 Views)