Lolly 1.4.28
Loading...
Searching...
No Matches
Typedefs | Functions
minmax.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int SI
 
typedef unsigned int SN
 
typedef short HI
 
typedef unsigned short HN
 
typedef char QI
 
typedef unsigned char QN
 
typedef long long int DI
 
typedef unsigned long long int DN
 

Functions

SI min (SI i, SI j)
 Returns the minimum of two signed integers.
 
SI max (SI i, SI j)
 Returns the maximum of two signed integers.
 
DI min (DI i, DI j)
 Returns the minimum of two signed integers.
 
DI max (DI i, DI j)
 Returns the maximum of two signed integers.
 
double min (double i, double j)
 Returns the minimum of two doubles.
 
double max (double i, double j)
 Returns the maximum of two doubles.
 

Detailed Description

defines basic type aliases and min/max function for these types.

Author
Joris van der Hoeven
Date
1999

Definition in file minmax.hpp.

Typedef Documentation

◆ SI

typedef int SI

Definition at line 10 of file minmax.hpp.

◆ SN

Definition at line 11 of file minmax.hpp.

◆ HI

Definition at line 12 of file minmax.hpp.

◆ HN

Definition at line 13 of file minmax.hpp.

◆ QI

Definition at line 14 of file minmax.hpp.

◆ QN

Definition at line 15 of file minmax.hpp.

◆ DI

Definition at line 16 of file minmax.hpp.

◆ DN

Definition at line 17 of file minmax.hpp.

Function Documentation

◆ min() [1/3]

SI min ( SI i,
SI j )
inline

Returns the minimum of two signed integers.

Parameters
iThe first integer.
jThe second integer.
Returns
The smaller of the two integers.

Definition at line 27 of file minmax.hpp.

27 {
28 if (i < j) return i;
29 else return j;
30}
The list class represents a linked list.
Definition list.hpp:48

◆ max() [1/3]

SI max ( SI i,
SI j )
inline

Returns the maximum of two signed integers.

Parameters
iThe first integer.
jThe second integer.
Returns
The larger of the two integers.

Definition at line 40 of file minmax.hpp.

40 {
41 if (i > j) return i;
42 else return j;
43}

◆ min() [2/3]

DI min ( DI i,
DI j )
inline

Returns the minimum of two signed integers.

Parameters
iThe first integer.
jThe second integer.
Returns
The smaller of the two integers.

Definition at line 53 of file minmax.hpp.

53 {
54 if (i < j) return i;
55 else return j;
56}

◆ max() [2/3]

DI max ( DI i,
DI j )
inline

Returns the maximum of two signed integers.

Parameters
iThe first integer.
jThe second integer.
Returns
The larger of the two integers.

Definition at line 66 of file minmax.hpp.

66 {
67 if (i > j) return i;
68 else return j;
69}

◆ min() [3/3]

double min ( double i,
double j )
inline

Returns the minimum of two doubles.

Parameters
iThe first double.
jThe second double.
Returns
The smaller of the two doubles.

Definition at line 79 of file minmax.hpp.

79 {
80 if (i < j) return i;
81 else return j;
82}

◆ max() [3/3]

double max ( double i,
double j )
inline

Returns the maximum of two doubles.

Parameters
iThe first double.
jThe second double.
Returns
The larger of the two doubles.

Definition at line 92 of file minmax.hpp.

92 {
93 if (i > j) return i;
94 else return j;
95}