---
name: "fmemcmp"
section: "3"
platform: "linux"
package: "libfstrcmp-dev"
version: "0.7.D001-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/fmemcmp"
---

# fmemcmp(3)

fuzzy comparison of two memory areas

## NAME

fmemcmp - fuzzy comparison of two memory areas

## SYNOPSIS

\#include \<fstrcmp.h\>

\#define FSTRCMP\_IDENTICAL\
 \#define FSTRCMP\_THRESHOLD\
 \#define FSTRCMP\_ERROR

double fmemcmp(const void \*data1, size\_t size1, const void \*data2, size\_t size2);

## DESCRIPTION

The **fmemcmp**() function compares the two memory areas, the *size1* bytes pointed to by *data1* and the *size2* bytes pointed to by *data2*.

## RETURN VALUE

The **fmemcmp** function returns a floating point value between 0.0 and FSTRCMP\_IDENTICAL.  A value of 0.0 means the memory areas are utterly un‐alike.  A value of FSTRCMP\_IDENTICAL means the memory areas are identical.  A value of more than FSTRCMP\_THRESHOLD (it lies between 0.0 and FSTRCMP\_IDENTICAL) would be considered "similar" by most people.

A value of FSTRCMP\_ERROR (always negative) indicates a [*malloc*(3)](/malloc/3.md) failure.

## SEE ALSO

- [*fmemcmpi*(3)](/fmemcmpi/3.md)

  fuzzy comparison of two memory areas

- [*fstrcmp*(3)](/fstrcmp/3.md)

  fuzzy comparison of two strings

- [*memcmp*(3)](/memcmp/3.md)

  compare memory areas

## COPYRIGHT

fstrcmp version 0.7\
 Copyright (C) 2009 Peter Miller\
 Peter Miller \<pmiller@opensource.org.au\>

The comparison code is derived from the fuzzy comparison functions in GNU Gettext 0.17.  The GNU Gettext comparison functions were, in turn, derived from GNU Diff 2.7.

Copyright (C) 1988-2009 Free Software Foundation
