Files
42_INT_09_piscine_cpp/d06/ex00/convert.h
2022-03-07 22:30:41 +01:00

70 lines
2.1 KiB
C++

#ifndef CONVERT_H
# define CONVERT_H
#include <iostream>
#include <string>
#include <iomanip> // setw()
#include <cctype> // isdigit()
#include <limits> // numeric_limits<type>
#include <cstdlib> // strtod()
#include <cerrno> // errno
void convert(std::string str);
bool checkChar(std::string str);
bool checkInt(std::string str);
bool checkFloat(std::string str);
bool checkDouble(std::string str);
#define MAX_INT "2147483647"
#define MIN_INT "-2147483648"
#define MAX_INT_1 "2147483648"
#define MIN_INT_1 "-2147483649"
#define INT_MAX_LENGTH 10
#define MAX_FLOAT_INT_PRECISION "16777216"
#define MAX_FLOAT_INT_PREC__1 "16777215"
#define MAX_FLOAT_INT_PREC__2 "16777214"
#define MAX_FLOAT_INT_PREC__3 "16777213"
#define MAX_FLOAT_INT_PREC__4 "16777212"
#define MAX_FLOAT_INT_PREC_1 "16777217"
#define MAX_FLOAT_INT_PREC_2 "16777218"
#define MAX_FLOAT_INT_PREC_3 "16777219"
#define MAX_FLOAT_INT_PREC_4 "16777220"
#define MAX_FLOAT_INT_PREC_5 "16777221"
#define MAX_FLOAT_INT_PREC_6 "16777222"
#define MAX_FLOAT "340282346638528859811704183484516925440"
#define MAX_F__1 "340282346638528859811704183484516925439"
#define MAX_F__2 "340282346638528859811704183484516925438"
#define MAX_F__3 "340282346638528859811704183484516925437"
#define MAX_F__4 "340282346638528859811704183484516925436"
#define MAX_F_1 "340282346638528859811704183484516925441"
#define MAX_F_2 "340282346638528859811704183484516925442"
#define MAX_F_3 "340282346638528859811704183484516925443"
#define MAX_F_4 "340282346638528859811704183484516925444"
#define MAX_F_5 "340282346638528859811704183484516925445"
#define MAX_F_6 "340282346638528859811704183484516925446"
#define FLOAT_MAX_LENGTH 56
// colors
# define GRAY "\e[0;30m"
# define RED "\e[0;31m"
# define GREEN "\e[0;32m"
# define YELLOW "\e[0;33m"
# define BLUE "\e[0;34m"
# define PURPLE "\e[0;35m"
# define CYAN "\e[0;36m"
# define WHITE "\e[0;37m"
# define B_GRAY "\e[1;30m"
# define B_RED "\e[1;31m"
# define B_GREEN "\e[1;32m"
# define B_YELLOW "\e[1;33m"
# define B_BLUE "\e[1;34m"
# define B_PURPLE "\e[1;35m"
# define B_CYAN "\e[1;36m"
# define B_WHITE "\e[1;37m"
# define RESET "\e[0m"
#endif