Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 02d552c

Browse files
committed
Round off random_normal() test results one more decimal place.
As I suspected, some machines have even more low-order-bit inaccuracy than the ones I tested. Tweak new test so that (hopefully) it will pass everywhere. Per buildfarm. Discussion: https://postgr.es/m/4173840.1673290336@sss.pgh.pa.us
1 parent f745739 commit 02d552c

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/test/regress/expected/random.out

+25-25
Original file line numberDiff line numberDiff line change
@@ -113,34 +113,34 @@ SELECT random() FROM generate_series(1, 10);
113113
-- Likewise for random_normal(); however, since its implementation relies
114114
-- on libm functions that have different roundoff behaviors on different
115115
-- machines, we have to round off the results a bit to get consistent output.
116-
SET extra_float_digits = 0;
116+
SET extra_float_digits = -1;
117117
SELECT random_normal() FROM generate_series(1, 10);
118-
random_normal
119-
--------------------
120-
0.208534644938377
121-
0.264530240540963
122-
-0.606752467900428
123-
0.825799427852654
124-
1.70111611735357
125-
-0.223445463716189
126-
0.249712419190998
127-
-1.2494722990669
128-
0.125627152043677
129-
0.475391614544013
118+
random_normal
119+
-------------------
120+
0.20853464493838
121+
0.26453024054096
122+
-0.60675246790043
123+
0.82579942785265
124+
1.7011161173536
125+
-0.22344546371619
126+
0.249712419191
127+
-1.2494722990669
128+
0.12562715204368
129+
0.47539161454401
130130
(10 rows)
131131

132132
SELECT random_normal(mean => 1, stddev => 0.1) r FROM generate_series(1, 10);
133-
r
134-
-------------------
135-
1.00605972811732
136-
1.09685453015002
137-
1.02869206132007
138-
0.909475676712336
139-
0.983724763134265
140-
0.939344549577623
141-
1.18713500206363
142-
0.962257684292933
143-
0.914441206800407
144-
0.964031055575433
133+
r
134+
------------------
135+
1.0060597281173
136+
1.09685453015
137+
1.0286920613201
138+
0.90947567671234
139+
0.98372476313426
140+
0.93934454957762
141+
1.1871350020636
142+
0.96225768429293
143+
0.91444120680041
144+
0.96403105557543
145145
(10 rows)
146146

src/test/regress/sql/random.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ SELECT random() FROM generate_series(1, 10);
7979
-- Likewise for random_normal(); however, since its implementation relies
8080
-- on libm functions that have different roundoff behaviors on different
8181
-- machines, we have to round off the results a bit to get consistent output.
82-
SET extra_float_digits = 0;
82+
SET extra_float_digits = -1;
8383

8484
SELECT random_normal() FROM generate_series(1, 10);
8585
SELECT random_normal(mean => 1, stddev => 0.1) r FROM generate_series(1, 10);

0 commit comments

Comments
 (0)