Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
JLimits.cc File Reference

Example program to test zero values (JMATH::zero). More...

#include <iostream>
#include <iomanip>
#include <limits>
#include "JMath/JLimits.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, CLASS)   print<CLASS>(OUT, #CLASS)
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test zero values (JMATH::zero).

Author
mdejong

Definition in file JLimits.cc.

Macro Definition Documentation

#define PRINT (   OUT,
  CLASS 
)    print<CLASS>(OUT, #CLASS)

Definition at line 74 of file JLimits.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 84 of file JLimits.cc.

85 {
86  using namespace std;
87 
88  int debug;
89 
90  try {
91 
92  JParser<> zap("Example program to test zero values of non-primitive data types.");
93 
94  zap['d'] = make_field(debug) = 3;
95 
96  zap(argc, argv);
97  }
98  catch(const exception &error) {
99  FATAL(error.what() << endl);
100  }
101 
102  using namespace JPP;
103 
104  PRINT(cout, size_t);
105  PRINT(cout, int);
106  PRINT(cout, float);
107  PRINT(cout, double);
108  PRINT(cout, long double);
109  PRINT(cout, __A__);
110 
111  ASSERT(JLimits<size_t>::min() == numeric_limits<size_t>::min());
112  ASSERT(JLimits<size_t>::max() == numeric_limits<size_t>::max());
113  //ASSERT(JLimits<double>::min() == numeric_limits<double>::min());
114  ASSERT(JLimits<double>::max() == numeric_limits<double>::max());
115  ASSERT(JLimits<__A__> ::min() == A_MIN);
116  ASSERT(JLimits<__A__> ::max() == A_MAX);
117 
118  return 0;
119 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define PRINT(OUT, CLASS)
Definition: JLimits.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level