File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
src/main/java/org/truffleruby/core/numeric Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 13
13
14
14
public class BignumOperations {
15
15
16
- private static final BigInteger LONG_MIN_BIGINT = BigInteger .valueOf (Long .MIN_VALUE );
17
- private static final BigInteger LONG_MAX_BIGINT = BigInteger .valueOf (Long .MAX_VALUE );
18
-
19
16
public static RubyBignum createBignum (BigInteger value ) {
20
- assert value .compareTo (LONG_MIN_BIGINT ) < 0 ||
21
- value .compareTo (LONG_MAX_BIGINT ) > 0 : "Bignum in long range : " + value ;
22
- final RubyBignum instance = new RubyBignum (value );
23
17
// TODO BJF Jul-30-2020 Add allocation tracing
24
- return instance ;
18
+ return new RubyBignum ( value ) ;
25
19
}
26
20
27
21
}
Original file line number Diff line number Diff line change 23
23
@ ExportLibrary (InteropLibrary .class )
24
24
public final class RubyBignum extends ImmutableRubyObjectNotCopyable {
25
25
26
+ private static final BigInteger LONG_MIN_BIGINT = BigInteger .valueOf (Long .MIN_VALUE );
27
+ private static final BigInteger LONG_MAX_BIGINT = BigInteger .valueOf (Long .MAX_VALUE );
28
+
26
29
public final BigInteger value ;
27
30
28
31
public RubyBignum (BigInteger value ) {
32
+ assert value .compareTo (LONG_MIN_BIGINT ) < 0 ||
33
+ value .compareTo (LONG_MAX_BIGINT ) > 0 : "Bignum in long range : " + value ;
29
34
this .value = value ;
30
35
}
31
36
You can’t perform that action at this time.
0 commit comments