GY-63_MS5611/libraries/Complex/examples/const/const.ino

46 lines
727 B
Arduino
Raw Normal View History

2021-11-16 03:37:28 -05:00
//
// FILE: const.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-11-15
//
// PUPROSE: test complex math - https://github.com/RobTillaart/Complex/issues/7
//
2021-12-14 09:48:21 -05:00
2021-11-16 03:37:28 -05:00
#include "Complex.h"
2021-12-14 09:48:21 -05:00
2021-11-16 03:37:28 -05:00
void setup()
{
Serial.begin(115200);
Serial.print(__FILE__);
Serial.print("\n COMPLEX_LIB_VERSION: ");
Serial.println(COMPLEX_LIB_VERSION);
const Complex unity(1, 0);
Complex a(1,1);
Complex b(2,2);
Complex c = unity * a + b;
Serial.println(a);
Serial.println(b);
Serial.println(c);
const Complex d(1,1);
// The next line is a warning on AVR
// But an error on other platforms (which is correct)
// d *= b;
Serial.println(d);
Serial.println("\ndone...");
}
2021-12-14 09:48:21 -05:00
2021-11-16 03:37:28 -05:00
void loop()
{
}
2021-12-14 09:48:21 -05:00
2021-11-16 03:37:28 -05:00
// -- END OF FILE --
2021-12-14 09:48:21 -05:00