nataraj: (Бритый небритый)
[personal profile] nataraj
My colleague Alex_Ignatov@facebook.com found curious behavior of random():

postgres=# select (select random() as value ) from generate_series(1,10) as k;
       value       
-------------------
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
 0.715956253930926
(10 rows)


Something like
int rnd=5; // This figure is really random. Got it by rolling a die

;-)
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

nataraj: (Default)
Swami Dhyan Nataraj

July 2024

S M T W T F S
 123456
789 10111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 31st, 2025 06:14 am
Powered by Dreamwidth Studios