What's with 181783497276652981 and 8682522807148012 in Random (Java 7)?

后端 未结 3 1176
天涯浪人
天涯浪人 2021-01-29 21:25

Why were 181783497276652981 and 8682522807148012 chosen in Random.java?

Here\'s the relevant source code from Java SE JDK 1.7:

3条回答
  •  清酒与你
    2021-01-29 21:50

    As per the link you provided, they have chosen (after adding the missing 1 :) ) the best yield from 2^64 because long can't have have a number from 2^128

提交回复
热议问题