| 6583 | |
| 6584 | |
| 6585 | dsc* evlSign(thread_db* tdbb, const SysFunction*, const NestValueArray& args, |
| 6586 | impure_value* impure) |
| 6587 | { |
| 6588 | fb_assert(args.getCount() == 1); |
| 6589 | |
| 6590 | Request* request = tdbb->getRequest(); |
| 6591 | |
| 6592 | const dsc* value = EVL_expr(tdbb, request, args[0]); |
| 6593 | if (request->req_flags & req_null) // return NULL if value is NULL |
| 6594 | return NULL; |
| 6595 | |
| 6596 | if (value->isDecFloat()) |
| 6597 | impure->vlu_misc.vlu_short = MOV_get_dec128(tdbb, value).sign(); |
| 6598 | else |
| 6599 | { |
| 6600 | const double val = MOV_get_double(tdbb, value); |
| 6601 | |
| 6602 | if (val > 0) |
| 6603 | impure->vlu_misc.vlu_short = 1; |
| 6604 | else if (val < 0) |
| 6605 | impure->vlu_misc.vlu_short = -1; |
| 6606 | else // val == 0 |
| 6607 | impure->vlu_misc.vlu_short = 0; |
| 6608 | } |
| 6609 | |
| 6610 | impure->vlu_desc.makeShort(0, &impure->vlu_misc.vlu_short); |
| 6611 | |
| 6612 | return &impure->vlu_desc; |
| 6613 | } |
| 6614 | |
| 6615 | |
| 6616 | dsc* evlSqrt(thread_db* tdbb, const SysFunction* function, const NestValueArray& args, |
nothing calls this directly
no test coverage detected