P99
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
p99_double.h
Go to the documentation of this file.
00001 /* This may look like nonsense, but it really is -*- mode: C -*-             */
00002 /*                                                                           */
00003 /* Except of parts copied from previous work and as explicitly stated below, */
00004 /* the author and copyright holder for this work is                          */
00005 /* (C) copyright  2010-2011 Jens Gustedt, INRIA, France                      */
00006 /*                                                                           */
00007 /* This file is free software; it is part of the P99 project.                */
00008 /* You can redistribute it and/or modify it under the terms of the QPL as    */
00009 /* given in the file LICENSE. It is distributed without any warranty;        */
00010 /* without even the implied warranty of merchantability or fitness for a     */
00011 /* particular purpose.                                                       */
00012 /*                                                                           */
00013 #ifndef     P99_DOUBLE_H_
00014 # define    P99_DOUBLE_H_
00015 
00016 #include "p99_if.h"
00017 
00033 #define P00_DEC_DOUBLE(SIGN, INT, FRAC, ESIGN, EXP, ...)       \
00034   P99_IF_EMPTY(SIGN)(+)(SIGN)P00_SKIP_ P99_PASTE(              \
00035   P99_IF_EMPTY(INT)(0)(INT),                                   \
00036   .,                                                           \
00037   P99_IF_EMPTY(FRAC)(0)(FRAC),                                 \
00038   E,                                                           \
00039   P99_IF_EMPTY(ESIGN)(+)(ESIGN),                               \
00040   P99_IF_EMPTY(EXP)(0)(EXP),                                   \
00041   __VA_ARGS__)
00042 
00043 #ifdef P00_DOXYGEN
00044 
00060 #define P99_DEC_DOUBLE(SIGN, INT, FRAC, ESIGN, EXP)
00061 #else
00062 P00_DOCUMENT_NUMBER_ARGUMENT(P99_DEC_DOUBLE, 1)
00063 P00_DOCUMENT_NUMBER_ARGUMENT(P99_DEC_DOUBLE, 2)
00064 P00_DOCUMENT_NUMBER_ARGUMENT(P99_DEC_DOUBLE, 4)
00065 #define P99_DEC_DOUBLE(...)                                    \
00066   P99_IF_GE(P99_NARG(__VA_ARGS__), 6)                          \
00067   (P00_DEC_DOUBLE(__VA_ARGS__))                                \
00068   (P00_DEC_DOUBLE(__VA_ARGS__,,,,,))
00069 #endif
00070 
00071 
00072 #define P00_HEX_DOUBLE(SIGN, HEXINT, HEXFRAC, ESIGN, BINEXP, ...) \
00073   P99_IF_EMPTY(SIGN)(+)(SIGN)P00_SKIP_ P99_PASTE(                 \
00074   0x,                                                             \
00075   P99_IF_EMPTY(HEXINT)(0)(HEXINT),                                \
00076   .,                                                              \
00077   P99_IF_EMPTY(HEXFRAC)(0)(HEXFRAC),                              \
00078   P,                                                              \
00079   P99_IF_EMPTY(ESIGN)(+)(ESIGN),                                  \
00080   P99_IF_EMPTY(BINEXP)(0)(BINEXP),                                \
00081   __VA_ARGS__)
00082 
00083 #ifdef P00_DOXYGEN
00084 
00089 #define P99_HEX_DOUBLE(SIGN, HEXINT, HEXFRAC, ESIGN, BINEXP)
00090 #else
00091 P00_DOCUMENT_NUMBER_ARGUMENT(P99_HEX_DOUBLE, 1)
00092 P00_DOCUMENT_NUMBER_ARGUMENT(P99_HEX_DOUBLE, 2)
00093 P00_DOCUMENT_NUMBER_ARGUMENT(P99_HEX_DOUBLE, 4)
00094 #define P99_HEX_DOUBLE(...)                                    \
00095   P99_IF_GE(P99_NARG(__VA_ARGS__), 6)                          \
00096   (P00_HEX_DOUBLE(__VA_ARGS__))                                \
00097   (P00_HEX_DOUBLE(__VA_ARGS__,,,,,))
00098 #endif
00099 
00105 #endif      /* !P99_DOUBLE_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines