From 41e547e60cffcaaa2a5a9aeb54df3295b8d88426 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 4 May 2020 00:27:14 +0900 Subject: [PATCH] Fixed constant initializer An expression using `static const` value seems not considered as `static const` by Visual C. --- random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/random.c b/random.c index de2767a93d..dc4ad760e4 100644 --- a/random.c +++ b/random.c @@ -88,7 +88,7 @@ int_pair_to_real_exclusive(uint32_t a, uint32_t b) static const int a_shift = DBL_MANT_DIG < 64 ? (64-DBL_MANT_DIG)/2 : 0; static const int b_shift = DBL_MANT_DIG < 64 ? - (64-DBL_MANT_DIG)-a_shift : 0; + (65-DBL_MANT_DIG)/2 : 0; a >>= a_shift; b >>= b_shift; return (a*(double)(1ul<<(32-b_shift))+b)*dbl_reduce_scale;