Skip to content

Commit f39915a

Browse files
committed
rand_distr: work around tan func issue
1 parent 802ba8f commit f39915a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rand_distr/src/cauchy.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ mod test {
130130
assert_eq!(buf, expected);
131131
}
132132

133+
// Warning: in a few cases, results vary slightly between different
134+
// platforms, presumably due to differences in precision of system impls
135+
// of the tan function. We work around this by avoiding these values.
133136
test_samples(100f64, 10.0, &[77.93369152808678, 90.1606912098641,
134137
125.31516221323625, 86.10217834773925]);
135-
test_samples(20f32, 10.0, &[27.175842, -2.0663052, 11.013268, 10.160688]);
138+
test_samples(10f32, 7.0, &[15.023088, -5.446413, 3.7092876, 3.112482]);
136139
}
137140
}

0 commit comments

Comments
 (0)