Skip to main content

try_f64_to_hugeint

Function try_f64_to_hugeint 

Source
pub unsafe fn try_f64_to_hugeint(value: f64) -> Option<i128>
Expand description

Converts an f64 to HUGEINT like f64_to_hugeint, or None when DuckDB cannot convert it: NaN, an infinity, or a value outside (-2^127, 2^127).

The bounds are the ones DuckDB’s ConvertFloatingToBigint applies (hugeint.cpp), checked here before the call.

§Safety

See date_from_days.