#include#include "floatpoint.hpp" int main() { // Create FloatPoint objects fpt::FloatPoint a(1.23); fpt::FloatPoint b(4.56); // Perform arithmetic operations fpt::FloatPoint c = a + b; fpt::FloatPoint d = a * b; // Print results std::cout << c.to_string() << std::endl; std::cout << d.to_string() << std::endl; return 0; }
#includeThis code creates two FloatPoint objects with initial values, performs complex arithmetic operations with them, and prints the results. The FloatPoint library is included as a header-only library.#include "floatpoint.hpp" int main() { // Create FloatPoint objects fpt::FloatPoint a(1.23); fpt::FloatPoint b(4.56); // Perform complex arithmetic operations fpt::FloatPoint c = a.sqrt() + b.abs() * a.log(); fpt::FloatPoint d = (a + b).pow(3).sin().asin().atan2(b); // Print results std::cout << c.to_string() << std::endl; std::cout << d.to_string() << std::endl; return 0; }