Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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)
 

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

◆ PRINT

#define PRINT ( OUT,
CLASS )
Value:
print<CLASS>(OUT, #CLASS)
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.

Definition at line 74 of file JLimits.cc.

Function Documentation

◆ main()

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}
#define PRINT(OUT, CLASS)
Definition JLimits.cc:74
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for minimum and maximum values for any class.
Definition JLimits.hh:21