class Float

def ffi_yajl(yajl_gen, state)

def ffi_yajl(yajl_gen, state)
  str = to_s
  if str == "NaN" || str == "Infinity" || str == "-Infinity"
    raise ::FFI_Yajl::EncodeError, "'#{str}' is an invalid number"
  end
  if state[:processing_key]
    if ( status = FFI_Yajl.yajl_gen_string(yajl_gen, str, str.bytesize) ) != 0
      FFI_Yajl::Encoder.raise_error_for_status(status, str)
    end
  else
    if ( status = FFI_Yajl.yajl_gen_number(yajl_gen, str, str.bytesize) ) != 0
      FFI_Yajl::Encoder.raise_error_for_status(status, str)
    end
  end
end