2014-02-11 11:26:28 +01:00
|
|
|
#define _USE_MATH_DEFINES
|
|
|
|
|
|
|
|
//
|
|
|
|
void rpn_e(void)
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//putf(M_E);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_log()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = log10(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_alog()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = pow(((number*)_stack->get_obj(0))->_value, 10);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_ln()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = log(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_exp()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = exp(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_sinh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = sinh(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_asinh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
2014-02-11 11:26:28 +01:00
|
|
|
|
2017-04-17 23:10:53 +02:00
|
|
|
//floating_t value = ((number*)_stack->get_obj(0))->_value;
|
|
|
|
//if(value>0)
|
|
|
|
// value = log(value + sqrt(value * value + 1));
|
|
|
|
//else
|
|
|
|
// value = -log(-value + sqrt(value * value + 1));
|
2014-02-11 11:26:28 +01:00
|
|
|
|
2017-04-17 23:10:53 +02:00
|
|
|
//((number*)_stack->get_obj(0))->_value = value;
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_cosh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = cosh(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_acosh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
2014-02-11 11:26:28 +01:00
|
|
|
|
2017-04-17 23:10:53 +02:00
|
|
|
//floating_t value = ((number*)_stack->get_obj(0))->_value;
|
|
|
|
//if(value>0)
|
|
|
|
// value = log(value + sqrt(value * value - 1));
|
|
|
|
//else
|
|
|
|
// value = -log(-value + sqrt(value * value - 1));
|
2014-02-11 11:26:28 +01:00
|
|
|
|
2017-04-17 23:10:53 +02:00
|
|
|
//((number*)_stack->get_obj(0))->_value = value;
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_tanh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
|
|
|
//((number*)_stack->get_obj(0))->_value = tanh(((number*)_stack->get_obj(0))->_value);
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void rpn_atanh()
|
|
|
|
{
|
2017-04-17 23:10:53 +02:00
|
|
|
//TODO
|
|
|
|
//MIN_ARGUMENTS(1);
|
|
|
|
//ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
2014-02-11 11:26:28 +01:00
|
|
|
|
2017-04-17 23:10:53 +02:00
|
|
|
//floating_t value = ((number*)_stack->get_obj(0))->_value;
|
|
|
|
//value = (log(1 + value) - log(1 - value)) / 2;
|
|
|
|
//((number*)_stack->get_obj(0))->_value = value;
|
2014-02-11 11:26:28 +01:00
|
|
|
}
|