Sum of three cubes

BigNum bigint at std.d
Sun Sep 8 13:45:34 UTC 2019


import std.stdio, std.bigint;

//
// https://twitter.com/robinhouston/status/1169877007045296128
//

void main()
{
     BigInt a = "80538738812075974";
     BigInt b = "80435758145817515";
     BigInt c = "12602123297335631";

     writeln("42=", (-a)^^3 + b^^3 + c^^3);
}



More information about the Digitalmars-d-learn mailing list