#include #include #include #include #include #include "helper.h" using namespace Poincare; QUIZ_CASE(poincare_power_evaluate) { Complex a[1] = {Complex::Float(8.0f)}; assert_parsed_expression_evaluates_to("2^3", a); Complex b[1] = {Complex::Cartesian(28.0, 96.0)}; assert_parsed_expression_evaluates_to("(3+I)^4", b); Complex c[1] = {Complex::Cartesian(11.7412464f, 62.9137754f)}; assert_parsed_expression_evaluates_to("4^(3+I)", c); #if MATRICES_ARE_DEFINED Complex d[4] = {Complex::Float(37.0), Complex::Float(54.0), Complex::Float(81.0), Complex::Float(118.0)}; assert_parsed_expression_evaluates_to("[[1,2][3,4]]^3", d, 2, 2); #endif Complex e[1] = {Complex::Float(0.0f)}; assert_parsed_expression_evaluates_to("0^2", e); Complex f[1] = {Complex::Float(std::exp(-M_PI_2))}; assert_parsed_expression_evaluates_to("I^I", f); }