| GNU Scientific Library Reference Manual - Third Edition (v1.12) by M. Galassi, J. Davies, J. Theiler, B. Gough, G. Jungman, P. Alken, M. Booth, F. Rossi Paperback (6"x9"), 592 pages, 60 figures ISBN 0954612078 RRP £24.95 ($39.95) |
4.7 Maximum and Minimum functions
Note that the following macros perform multiple evaluations of their arguments, so they should not be used with arguments that have side effects (such as a call to a random number generator).
- Macro: GSL_MAX (a, b)
- This macro returns the maximum of a and b. It is defined
as
((a) > (b) ? (a):(b)).
- Macro: GSL_MIN (a, b)
- This macro returns the minimum of a and b. It is defined as
((a) < (b) ? (a):(b)).
- Function: extern inline double GSL_MAX_DBL (double a, double b)
- This function returns the maximum of the double precision numbers
a and b using an inline function. The use of a function
allows for type checking of the arguments as an extra safety feature. On
platforms where inline functions are not available the macro
GSL_MAXwill be automatically substituted.
- Function: extern inline double GSL_MIN_DBL (double a, double b)
- This function returns the minimum of the double precision numbers
a and b using an inline function. The use of a function
allows for type checking of the arguments as an extra safety feature. On
platforms where inline functions are not available the macro
GSL_MINwill be automatically substituted.
- Function: extern inline int GSL_MAX_INT (int a, int b)
- Function: extern inline int GSL_MIN_INT (int a, int b)
- These functions return the maximum or minimum of the integers a
and b using an inline function. On platforms where inline
functions are not available the macros
GSL_MAXorGSL_MINwill be automatically substituted.
- Function: extern inline long double GSL_MAX_LDBL (long double a, long double b)
- Function: extern inline long double GSL_MIN_LDBL (long double a, long double b)
- These functions return the maximum or minimum of the long doubles a
and b using an inline function. On platforms where inline
functions are not available the macros
GSL_MAXorGSL_MINwill be automatically substituted.
| ISBN 0954612078 | GNU Scientific Library Reference Manual - Third Edition (v1.12) | See the print edition |