Skip to content

walmartlabs-wmusiphone/JKBigInteger

 
 

Repository files navigation

JKBigInteger

About JKBigInteger

JKBigInteger is a small library to facilitate easy working with big integers in Objective-C. JKBigInteger is a Objective-C wrapper around LibTomMath C library. It is inspired by the Java's BigInteger.

Example

JKBigInteger *int1 = [[JKBigInteger alloc] initWithString:@"123"];

NSLog(@"%@ + %@ = %@", int1, int1, [int1 add:int1]);

JKBigInteger *int2 = [[JKBigInteger alloc] initWithString:@"10000001234567890123"];
JKBigInteger *int3 = [[JKBigInteger alloc] initWithString:@"123"];

NSLog(@"%@ - %@ = %@", int2, int3, [int2 subtract:int3]);

JKBigInteger *int4 = [[JKBigInteger alloc] initWithString:@"11111111111111111111"];

NSLog(@"%@ * %@ = %@", int4, int4, [int4 multiply:int4]);

JKBigInteger *int5 = [[JKBigInteger alloc] initWithString:@"10000001234567890123123123123"];
JKBigInteger *int6 = [[JKBigInteger alloc] initWithString:@"123"];

NSLog(@"%@ / %@ = %@", int5, int6, [int5 divide:int6]);

Credits

JKBigInteger was created by Jānis Kiršteins

License

JKBigInteger is available under the MIT license. See the LICENSE file for more info.

About

Library for working with big integers in Objective-C.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 90.0%
  • C 10.0%