MCPcopy Create free account
hub / github.com/apache/arrow / convert_toDOUBLE

Function convert_toDOUBLE

cpp/src/gandiva/precompiled/string_ops.cc:1567–1583  ·  view source on GitHub ↗

Converts a double variable to binary

Source from the content-addressed store, hash-verified

1565
1566// Converts a double variable to binary
1567FORCE_INLINE
1568const char* convert_toDOUBLE(int64_t context, double value, int32_t* out_len) {
1569 *out_len = sizeof(value);
1570 char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len));
1571
1572 if (ret == nullptr) {
1573 gdv_fn_context_set_error_msg(context,
1574 "Could not allocate memory for the output string");
1575
1576 *out_len = 0;
1577 return "";
1578 }
1579
1580 memcpy(ret, &value, *out_len);
1581
1582 return ret;
1583}
1584
1585FORCE_INLINE
1586const char* convert_toDOUBLE_be(int64_t context, double value, int32_t* out_len) {

Callers 2

convert_toDOUBLE_beFunction · 0.85
TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68