summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-04 00:27:14 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-04 00:27:14 +0900
commit41e547e60cffcaaa2a5a9aeb54df3295b8d88426 (patch)
tree43d01ae5a5841c2df89c305ecd7af3b5122bf046 /random.c
parentdfbbd94ec171dbf276ccc6d9c5adb6d4e8b347fc (diff)
Fixed constant initializer
An expression using `static const` value seems not considered as `static const` by Visual C.
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/random.c b/random.c
index de2767a..dc4ad76 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;