Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

__builtin_types_compatible_p(3) [netbsd man page]

__BUILTIN_TYPES_COMPATIBLE_P(3) 			   BSD Library Functions Manual 			   __BUILTIN_TYPES_COMPATIBLE_P(3)

NAME
__builtin_types_compatible_p -- GNU extension to check equivalent types SYNOPSIS
int __builtin_types_compatible_p(type_a, type_b); DESCRIPTION
The __builtin_types_compatible_p() is a GNU extension for determining whether two types are equivalent. If type_a is equivalent to type_b, a value 1 is returned. Otherwise __builtin_types_compatible_p() returns 0. The following remarks should be taken into account. 1. The architecture-specific size of the two types does not have an impact on the result. For example, sizeof(char *) and sizeof(int) result the same value on i386, but the types naturally are not equivalent. 2. Type qualifiers are ignored. The function returns the same value for long and const long. 3. The amount of pointer indirection affects the result. For example, double * is not equivalent to double **. 4. Two types defined with typedef are equivalent if and only if their underlying types are equivalent. 5. The enum type is a special case in that two enum types are not considered equivalent. EXAMPLES
The following example combines __builtin_types_compatible_p() and the typeof(3) construct: #define __COMPARE_TYPES(v, t) __builtin_types_compatible_p(__typeof__(v), t) ... if (__COMPARE_TYPES(p, double) != 0) err(EX_DATAERR, "invalid type"); SEE ALSO
gcc(1), __builtin_constant_p(3), typeof(3) CAVEATS
This is a non-standard, compiler-specific extension. BSD
December 21, 2010 BSD

Check Out this Related Man Page

LRINT(3)						   BSD Library Functions Manual 						  LRINT(3)

NAME
llrint, llrintf, llrintl, lrint, lrintf, lrintl -- convert to integer LIBRARY
Math Library (libm, -lm) SYNOPSIS
#include <math.h> long long llrint(double x); long long llrintf(float x); long long llrintl(long double x); long lrint(double x); long lrintf(float x); long lrintl(long double x); DESCRIPTION
The lrint() function returns the integer nearest to its argument x according to the current rounding mode. If the rounded result is too large to be represented as a long value, an invalid exception is raised and the return value is undefined. Otherwise, if x is not an inte- ger, lrint() raises an inexact exception. When the rounded result is representable as a long, the expression lrint(x) is equivalent to (long)rint(x) (although the former may be more efficient). The llrint(), llrintf(), llrintl(), lrintf(), and lrintl() functions differ from lrint() only in their input and output types. SEE ALSO
lround(3), math(3), rint(3), round(3) STANDARDS
These functions conform to ISO/IEC 9899:1999 (``ISO C99''). HISTORY
The llrint(), llrintf(), lrint(), and lrintf() routines first appeared in FreeBSD 5.4. The long double variants were introduced in FreeBSD 8.0. BSD
January 13, 2008 BSD
Man Page