Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 579 Bytes

File metadata and controls

12 lines (8 loc) · 579 Bytes

JavaKit Example: Using Java APIs from Swift

This package contains an example program that uses Java's java.math.BigInteger from Swift to determine whether a given number is probably prime. You can try it out with your own very big number:

swift run JavaProbablyPrime <very big number>

The package itself demonstrates how to:

  • Use the Java2Swift build tool plugin to wrap the java.math.BigInteger type in Swift.
  • Create an instance of BigInteger in Swift and use its isProbablyPrime.