### Method

# Vips Image remainder

#### Declaration [src]

    int
    vips_remainder (
      VipsImage* left,
      VipsImage* right,
      VipsImage** out,
      ...
    )

#### Description [src]

This operation calculates `left` % `right` (remainder after integer division) and writes the result to `out`. The images may have any non-complex format. For float formats, `vips_remainder()` calculates `in1` - `in2` * floor (`in1` / `in2`).

If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.

If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.

The two input images are cast up to the smallest common format (see table Smallest common format in arithmetic), and that format is the result type.

See also

`vips_remainder_const()`, `vips_divide()`, `vips_round()`.

This method is not directly available to language bindings.

#### Parameters

`right`

  Type: `VipsImage`

  Right-hand input `VipsImage`.

  The data is owned by the caller of the method.

`out`

  Type: `VipsImage`

  Output `VipsImage`.

  The argument will be set by the function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.