Complex
Example of using the standard library complex numbers.
- Boards: 🛈
- AVR, AVR USB, Nano Every, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Due, Teensy 3.x, ESP8266, ESP32
Output
Written by PieterP, 2019-11-14 https://github.com/tttapa/Arduino-Helpers
#include <AH/STL/complex>
void setup() {
Serial.begin(115200);
while (!Serial)
;
std::complex<double> c{0, 2};
Serial << "√(2i) = " << std::sqrt(c) << endl;
}
void loop() {}
Dummy header file for Arduino builder.