1 /*
2  fuzzylite (R), a fuzzy logic control library in C++.
3  Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved.
4  Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com>
5 
6  This file is part of fuzzylite.
7 
8  fuzzylite is free software: you can redistribute it and/or modify it under
9  the terms of the FuzzyLite License included with the software.
10 
11  You should have received a copy of the FuzzyLite License along with
12  fuzzylite. If not, see <http://www.fuzzylite.com/license/>.
13 
14  fuzzylite is a registered trademark of FuzzyLite Limited.
15  */
16 
17 #include "fl/fuzzylite.h"
18 
19 namespace fl {
20 
21 
22     int fuzzylite::_decimals = 3;
23     std::ios_base::fmtflags fuzzylite::_scalarFormat = std::ios_base::fixed;
24     scalar fuzzylite::_macheps = 1e-6;
25     bool fuzzylite::_debugging = false;
26     bool fuzzylite::_logging = true;
27 
platform()28     std::string platform() {
29 #ifdef FL_UNIX
30         return "Unix";
31 #elif defined FL_WINDOWS
32         return "Windows";
33 #else
34         return "?";
35 #endif
36     }
37 
floatingPoint()38     std::string floatingPoint() {
39         scalar someScalar = 0;
40         FL_IUNUSED(someScalar);
41         std::string type;
42 
43         std::ostringstream ss;
44 #ifdef FL_USE_FLOAT
45         type = "float";
46 #else
47         type = "double";
48 #endif
49         ss << "fl::scalar is defined as \'" << type << "\' using " <<
50                 sizeof (someScalar) << " bytes";
51         return ss.str();
52     }
53 }
54