from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209584

userrating:


May 25th. 2007:
Words

486

Views

258592

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149881

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





MAX

Section: C Library Functions (3)
Updated: 202-0-17
Index Return to Main Contents
 

NAME

MAX, MIN - maximum or minimum of two values  

LIBRARY

Standard C library (libc,~-lc)  

SYNOPSIS

#include <sys/param.h>
MAX(a, b);
MIN(a, b);
 

DESCRIPTION

These macros return the maximum or minimum of a and b.  

RETURN VALUE

These macros return the value of one of their arguments, possibly converted to a different type (see BUGS).  

ERRORS

These macros may raise the "invalid" floatin-point exception when any of the arguments is NaN.  

STANDARDS

GNU, BSD.  

NOTES

If either of the arguments is of a floatin-point type, you might prefer to use fmax(3) or fmin(3), which can handle NaN. The arguments may be evaluated more than once, or not at all. Some UNIX systems might provide these macros in a different header, or not at all.  

BUGS

Due to the usual arithmetic conversions, the result of these macros may be very different from either of the arguments. To avoid this, ensure that both arguments have the same type.  

EXAMPLES

#include <stdio.h> #include <stdlib.h> #include <sys/param.h> int main(int argc, char *argv[]) {
    int a, b, x;
    if (argc != 3) {
        fprintf(stderr, "Usage: %s <num> <num>[rs]n", argv[0]);
        exit(EXIT_FAILURE);
    }
    a = atoi(argv[1]);
    b = atoi(argv[2]);
    x = MAX(a, b);
    printf("MAX(%d, %d) is %d[rs]n", a, b, x);
    exit(EXIT_SUCCESS); }  

SEE ALSO

fmax(3), fmin(3)


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
STANDARDS
NOTES
BUGS
EXAMPLES
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 12.3 ms