Traditionally if I wish to choose a case occurred 25%, I use "arc4random()%" function by integer to trigger the case of 1/4 chance. Now I have 4 cases with float rate. Let's say,
A 0.3055
B 0.391
C 0.165
D 0.1485
A+B+C+D=1
How can I develop a random selector to trigger a case of 4 by properly selecting? Of course, case B gets the most chance to be selected.
Many thanks