You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
872 B

  1. //
  2. // Lol Engine — Sandbox program
  3. //
  4. // Copyright © 2005—2018 Sam Hocevar <sam@hocevar.net>
  5. //
  6. // This program is free software. It comes without any warranty, to
  7. // the extent permitted by applicable law. You can redistribute it
  8. // and/or modify it under the terms of the Do What the Fuck You Want
  9. // to Public License, Version 2, as published by the WTFPL Task Force.
  10. // See http://www.wtfpl.net/ for more details.
  11. //
  12. #if HAVE_CONFIG_H
  13. # include "config.h"
  14. #endif
  15. #include <lol/engine.h>
  16. using namespace lol;
  17. int main(int, char **)
  18. {
  19. timer t;
  20. bigint<128> x(17), y(23);
  21. x.print();
  22. y.print();
  23. auto z = x * y;
  24. z.print();
  25. for (int i = 0; i < 500000; ++i)
  26. {
  27. x = (bigint<128>)(x * x);
  28. x ^= y;
  29. }
  30. printf("%d %d\n", (int)x, (int)y);
  31. printf("Time: %f s\n", t.get());
  32. return EXIT_SUCCESS;
  33. }