using Long.MAX_VALUE
This commit is contained in:
parent
41370497fd
commit
ce62cb3dc0
|
@ -2,7 +2,6 @@ package com.baeldung.securerandompositivelong;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
@ -16,7 +15,8 @@ public class SecureRandomPositiveLongUnitTest {
|
||||||
|
|
||||||
assertThat(randomPositiveLong).isPositive();
|
assertThat(randomPositiveLong).isPositive();
|
||||||
|
|
||||||
Double pc = 1.0 / Math.pow(2, 63);
|
//Double pc = 1.0 / Math.pow(2, 63);
|
||||||
|
Double pc = 1.0 / Long.MAX_VALUE;
|
||||||
System.out.printf("%.40f", pc);
|
System.out.printf("%.40f", pc);
|
||||||
|
|
||||||
assertThat(pc).isLessThan(0.00000000000000001);
|
assertThat(pc).isLessThan(0.00000000000000001);
|
||||||
|
|
Loading…
Reference in New Issue