Skip to main content

f64_to_uhugeint

Function f64_to_uhugeint 

Source
pub unsafe fn f64_to_uhugeint(value: f64) -> u128
Expand description

Converts an f64 to UHUGEINT the way DuckDB does, truncating toward zero.

A value DuckDB cannot convert — NaN, an infinity, a negative value, or one at or above 2^128 — comes back as 0, indistinguishable from a real zero. Use try_f64_to_uhugeint to tell the two apart.

§Safety

See date_from_days.