IM_RINT(3)

IM_RINT3

Misc math macros

Usage

#include <vips/vips.h>

int IM_RINT( float )
any IM_MAX( any, any )
any IM_MIN( any, any )

Overview

These macros provide some simple but fast math functions --- IM_MAX(3) returns the maximum of its two arguments, IM_MIN(3) the smallest, and IM_RINT(3) rounds a float or double to the nearest integer.

Beware: these macros may evaluate their argument more than once, so you MUST NOT use ++,--, or a function call in their argument lists.

They are defined as:

#define IM_MAX(A,B) ((A)>(B)?(A):(B))
#define IM_MIN(A,B) ((A)<(B)?(A):(B))
#define IM_RINT(R) ((int)((R)>0?((R)+0.5):((R)-0.5)))

Releases

3 releases since Debian 3.1 (Sarge); the text changed 1 time.

  1. 3.1–4.0
  2. 5.0

Author

J. Cupitt - 23/7/93

From libvips-dev 7.14.5-1 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.