...> right about the ultimate calculation here: ! calculates percent of UB for b-a on a symmetricinterval [snip] Â inbounds = Â Â Â Â Â Â Â Â 749970 Â outbounds = Â Â Â Â Â ...25.0030 Â Â Â %% I wonder how big the interval can get before the numbers start to get "grainy" with b = -i_max + int( harvest * i_tot )? How would a person stich together 2 ...
... is better than  b = -i_max + int( harvest * i_tot ) That's a ... for b-a on a symmetricinterval implicit none integer, parameter ...real:: harvest, ratio, percent ! seed random num generator CALL init_random_seed ! prime ... call random_number(harvest) b = -i_max + int( harvest * i_tot ) call random_number(harvest)...I wonder how big the interval can get before the numbers ...
... on the right. For twos complement it would be -8. In the large number limit, it won't make a big difference. It was so simple to write a fortran program that the busts the C int datatype. One thing I dislike so much about c is struggling with the format specifiers with printf, while with fortran it's just print * for something quick and sleazy. Fortran didn't used to make ...
...suggested by the custom quote there with the negative in front of the first arg and then the same positive values on the right. It was so simple to write a fortran program that the busts the C int datatype. One thing I dislike so much about c is struggling with the format specifiers with printf, while with fortran it's just print * for something quick and sleazy. -- A cynic is a man who...
On Sep 17, 2:52 am, Ron Ford <r...@example.invalid> wrote: Why do I believe that b = min(max(1,ceiling(harvest*sides)),sides) is better than  b = -i_max + int( harvest * i_tot ) That's a matter of "taste". :-). For each of us our choice illustrates our own thought process. - e
... that the previously suggested: b = -i_max + int( harvest * i_tot ) ceiling(harvest*sides) mostly...> If you have two (approximately) symmetric distributions uniform over, for example, ... Richard wrote: %%- %%- %%- > Whats wrong with merely %%- >> %%- >> int mycmp(const void *a, const void ...for example, a simple four-bit int (with INT_MIN being -INT_MAX %%- - 1). ...
...F(i) = C(i) - i_max - 1 , I get all the outcomes. 2 questions here. 1) Why do I believe that b = min(max(1,ceiling(harvest*sides)),sides) is better than b = -i_max + int( harvest * i_tot ) ? 2) How did I not write out of bounds on an array with affairs being off by one ?? -- Most people are unable to write because they are unable to think, and they are unable to think...
...sides)),sides) is different that the previously suggested: > b = -i_max + int( harvest * i_tot ) ceiling(harvest*sides) mostly returns a value between... the counts in k(i_max+1) Either use floor() or int(), or subtract one. As far as the original question, ...fourth, not one eighth. If you have two (approximately) symmetric distributions uniform over, for example, the range (-1/2...
... harvest, diff, t3, t4 ! seed random num generator [snip] do i...give equiprobable integers on the interval of [-i_max , i_max] ? No. It...call random_number(harvest) b = -i_max + int( harvest * i_tot ) k(b) = k...picking a random integer over a range. 1 + int ( 6 * harvest...harvest, diff, t3, t4 ! seed random num generator CALL init_random_seed ! prime...
... real:: harvest, diff, t3, t4 ! seed random num generator [snip] do i = 1, ...does this prog give equiprobable integers on the interval of [-i_max , i_max] ? No. It looks like you...i=1,trials call random_number(harvest) b = -i_max + int( harvest * i_tot ) k(b) = k(b) + ... way of picking a random integer over a range. 1 + int ( 6 * harvest), for example, is the classical ...