[][src]Function lexical_core::set_inf_string_ffi

#[no_mangle]
pub unsafe extern "C" fn set_inf_string_ffi(ptr: *const u8, size: usize) -> i32

Set the short representation of Infinity from a pointer and size.

Returns 0 on success, -1 on error.

  • ptr - Pointer to the first character in the contiguous string.
  • size - Size of the string, without the null-terminator.

Safety

Only use this in C-FFI code, otherwise, you use set_inf_string. Do not call this function in threaded-code, as it is not thread-safe.

Panics

Panics if bytes.len() >= MAX_F32_SIZE.