mirror of
https://github.com/nqrduck/ATM.git
synced 2024-12-02 06:43:15 +00:00
38 lines
692 B
Text
38 lines
692 B
Text
// BigNumber test: powers
|
|
#include "BigNumber.h"
|
|
|
|
void setup ()
|
|
{
|
|
Serial.begin (115200);
|
|
Serial.println ();
|
|
BigNumber::begin (); // initialize library
|
|
|
|
Serial.println ("--- powers of 2 ---");
|
|
|
|
BigNumber a = 2;
|
|
|
|
for (int i = 1; i <= 300; i++)
|
|
{
|
|
Serial.print ("2^");
|
|
Serial.print (i);
|
|
Serial.print (" = ");
|
|
BigNumber p = a.pow (i);
|
|
Serial.println (p);
|
|
} // end of for loop
|
|
|
|
Serial.println ("--- powers of 3 ---");
|
|
|
|
a = 3;
|
|
|
|
for (int i = 1; i <= 300; i++)
|
|
{
|
|
Serial.print ("3^");
|
|
Serial.print (i);
|
|
Serial.print (" = ");
|
|
BigNumber p = a.pow (i);
|
|
Serial.println (p);
|
|
} // end of for loop
|
|
|
|
} // end of setup
|
|
|
|
void loop () { }
|