Jun. 28th, 2016

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

;-)

Profile

nataraj: (Default)
Swami Dhyan Nataraj

July 2024

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

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 28th, 2025 08:30 pm
Powered by Dreamwidth Studios