Skip to main content

try_f64_to_uhugeint

Function try_f64_to_uhugeint 

Source
pub unsafe fn try_f64_to_uhugeint(value: f64) -> Option<u128>
Expand description

Converts an f64 to UHUGEINT like f64_to_uhugeint, or None when DuckDB cannot convert it: NaN, an infinity, a negative value, or one at or above 2^128.

The bounds are the ones DuckDB’s ConvertFloatingToUhugeint applies (uhugeint.cpp), checked here before the call. -0.0 converts to 0.

§Safety

See date_from_days.