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

Function convert_toFLOAT

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

Converts a float variable to binary

Source from the content-addressed store, hash-verified

1597
1598// Converts a float variable to binary
1599FORCE_INLINE
1600const char* convert_toFLOAT(int64_t context, float value, int32_t* out_len) {
1601 *out_len = sizeof(value);
1602 char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len));
1603
1604 if (ret == nullptr) {
1605 gdv_fn_context_set_error_msg(context,
1606 "Could not allocate memory for the output string");
1607
1608 *out_len = 0;
1609 return "";
1610 }
1611
1612 memcpy(ret, &value, *out_len);
1613
1614 return ret;
1615}
1616
1617FORCE_INLINE
1618const char* convert_toFLOAT_be(int64_t context, float value, int32_t* out_len) {

Callers 2

convert_toFLOAT_beFunction · 0.85
TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68