diff --git a/docs/annotated.html b/docs/annotated.html index 813bb4b..18fc209 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -75,13 +75,14 @@ $(function() {
_os_version_t
for details! v |
j |
j |
r |
u |
h |
Classes | |
struct | _fp_parts_t |
This struct containes the parts (integral and fractional part) of a floating-point number. More... | |
class | IPCChannel |
class | JobObject |
class | Version |
+Typedefs | |
+typedef struct MUtils::_fp_parts_t | fp_parts_t |
This struct containes the parts (integral and fractional part) of a floating-point number. | |
Functions | |
MUTILS_API const QString & | temp_folder (void) | regexp_par
MUTILS_API QStringList | available_codepages (const bool &noAliases=true) | | Retrieve a list of all available codepages. More... | | MUTILS_API fp_parts_t | break_fp (const double value) | | Break floating-point number into fractional and integral parts. More... | | |
Variables | Taskbar7_
§ break_fp()+ +
+
diff --git a/docs/d4/d85/_job_object_8h_source.html b/docs/d4/d85/_job_object_8h_source.html
index e728c22..2af9f3d 100644
--- a/docs/d4/d85/_job_object_8h_source.html
+++ b/docs/d4/d85/_job_object_8h_source.html
@@ -70,7 +70,7 @@ $(function() {
Go to the documentation of this file.
+
+
+
Break floating-point number into fractional and integral parts. +The function returns a struct containing the fractional and the integral part of a given floating-point values as two separate values. This is a convenience warapper for the
This file contains miscellaneous functions that are generally useful for Qt-based applications... #define MUTILS_NO_COPY(CLASS) Disables copy constructor and assignment operator in the specified class. This macro should be used i... Definition: Global.h:384 #define MUTILS_NO_COPY(CLASS) Disables copy constructor and assignment operator in the specified class. This macro should be used i... Definition: Global.h:400 diff --git a/docs/d5/d3b/_global_8h.html b/docs/d5/d3b/_global_8h.html index bc8e1cd..2e23711 100644 --- a/docs/d5/d3b/_global_8h.html +++ b/docs/d5/d3b/_global_8h.html @@ -64,8 +64,10 @@ $(function() { Global.h File Reference Go to the source code of this file.
Detailed DescriptionThis file contains miscellaneous functions that are generally useful for Qt-based applications. diff --git a/docs/d5/d3b/_global_8h_source.html b/docs/d5/d3b/_global_8h_source.html index e70f51c..e0b5e30 100644 --- a/docs/d5/d3b/_global_8h_source.html +++ b/docs/d5/d3b/_global_8h_source.html @@ -67,13 +67,16 @@ $(function() {Global.h
-Go to the documentation of this file. 56 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 72 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 110 MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL); 154 MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false); 171 MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false); 300 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value, const size_t &offset); 316 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 *values, const size_t &count); 318 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 319 MUTILS_API bool regexp_parse_int32(const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); MUTILS_API QStringList available_codepages(const bool &noAliases=true) Retrieve a list of all available codepages. 56 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 72 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 115 MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList *const extraPaths = NULL); 159 MUTILS_API QString make_temp_file(const QString &basePath, const QString &extension, const bool placeholder = false); 176 MUTILS_API QString make_unique_file(const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false); 305 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value, const size_t &offset); 321 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 *values, const size_t &count); 323 MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 324 MUTILS_API bool regexp_parse_int32(const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); MUTILS_API QStringList available_codepages(const bool &noAliases=true) Retrieve a list of all available codepages. struct MUtils::_fp_parts_t fp_parts_t This struct containes the parts (integral and fractional part) of a floating-point number... MUTILS_API QString next_rand_str(const bool &bLong=false) Generates a random string. MUTILS_API QString clean_file_path(const QString &path, const bool &pretty) Clean up a file path string. This struct containes the parts (integral and fractional part) of a floating-point number... Definition: Global.h:91 MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase) Sort a list of strings using "natural ordering" algorithm. MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value) Parse regular expression results. MUTILS_API bool parity(quint32 value) Computes the parity of the given unsigned 32-Bit value. MUTILS_API fp_parts_t break_fp(const double value) Break floating-point number into fractional and integral parts. MUTILS_API quint64 next_rand_u64(void) Generates a random unsigned 64-Bit value. MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir=true, const QStringList *const extraPaths=NULL) Initialize a given QProcess object. MUTILS_API QString & trim_right(QString &str) Remove trailing white-space characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+MUtils::_fp_parts_t Struct Reference
+
+
+
+This struct containes the parts (integral and fractional part) of a floating-point number. + More... + +
Detailed Description+This struct containes the parts (integral and fractional part) of a floating-point number. +The documentation for this struct was generated from the following file:
+Generated by + + 1.8.12 + + + diff --git a/docs/df/d5e/struct_m_utils_1_1__fp__parts__t-members.html b/docs/df/d5e/struct_m_utils_1_1__fp__parts__t-members.html new file mode 100644 index 0000000..f518e63 --- /dev/null +++ b/docs/df/d5e/struct_m_utils_1_1__fp__parts__t-members.html @@ -0,0 +1,82 @@ + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+MUtils::_fp_parts_t Member List
+
+
+
+This is the complete list of members for MUtils::_fp_parts_t, including all inherited members. +
+Generated by + + 1.8.12 + + + diff --git a/docs/hierarchy.html b/docs/hierarchy.html index b169e69..14744e3 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -66,17 +66,18 @@ $(function() { This inheritance list is sorted roughly, but not completely, alphabetically: [detail level 12]
- b -
- c -
+
+
+
diff --git a/docs/search/functions_e.js b/docs/search/functions_e.js
new file mode 100644
index 0000000..f761a33
--- /dev/null
+++ b/docs/search/functions_e.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['_7ejobobject',['~JobObject',['../dc/dd3/class_m_utils_1_1_job_object.html#a0e2d6461729d16b615548e7b1594c893',1,'MUtils::JobObject']]]
+];
diff --git a/docs/search/searchdata.js b/docs/search/searchdata.js
index edddac3..42ab5f3 100644
--- a/docs/search/searchdata.js
+++ b/docs/search/searchdata.js
@@ -4,9 +4,9 @@ var indexSectionsWithContent =
1: "_hijlrtuv",
2: "m",
3: "cghjlo",
- 4: "acdgijmnprstu~",
+ 4: "abcdgijmnprstu~",
5: "bcfhimstuvwx",
- 6: "co",
+ 6: "cfo",
7: "dkno",
8: "dfno",
9: "m"
diff --git a/docs/search/typedefs_1.js b/docs/search/typedefs_1.js
index f39896d..3cb2c2b 100644
--- a/docs/search/typedefs_1.js
+++ b/docs/search/typedefs_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['os_5fversion_5ft',['os_version_t',['../d1/d7d/namespace_m_utils_1_1_o_s_1_1_version.html#a199c9376f9941b2ec9721eab0b544da0',1,'MUtils::OS::Version']]]
+ ['fp_5fparts_5ft',['fp_parts_t',['../d3/da6/namespace_m_utils.html#a75209365a097871cb2bb8fc3a21ce14b',1,'MUtils']]]
];
diff --git a/docs/search/typedefs_2.html b/docs/search/typedefs_2.html
new file mode 100644
index 0000000..07e259e
--- /dev/null
+++ b/docs/search/typedefs_2.html
@@ -0,0 +1,26 @@
+
+Loading...
+
+
+Searching...
+No Matches
+
+
+
+
+
diff --git a/docs/search/typedefs_2.js b/docs/search/typedefs_2.js
new file mode 100644
index 0000000..f39896d
--- /dev/null
+++ b/docs/search/typedefs_2.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['os_5fversion_5ft',['os_version_t',['../d1/d7d/namespace_m_utils_1_1_o_s_1_1_version.html#a199c9376f9941b2ec9721eab0b544da0',1,'MUtils::OS::Version']]]
+];
diff --git a/include/MUtils/Global.h b/include/MUtils/Global.h
index 956ca94..ce3f60c 100644
--- a/include/MUtils/Global.h
+++ b/include/MUtils/Global.h
@@ -86,13 +86,9 @@ class QProcess;
namespace MUtils
{
/**
- * \brief This struct containes the parts of a floating-point number
+ * \brief This struct containes the parts (integral and fractional part) of a floating-point number
*/
- typedef struct
- {
- double intpart, fractpart;
- }
- fp_parts_t;
+ typedef struct _fp_parts_t { double parts[2]; } fp_parts_t;
/**
* \brief Rerieves the full path of the application's *Temp* folder.
@@ -341,9 +337,11 @@ namespace MUtils
/**
* \brief Break floating-point number into fractional and integral parts
*
+ * The function returns a struct containing the fractional and the integral part of a given floating-point values as two separate values. This is a convenience warapper for the `modf()` function.
+ *
* \param value The original floating-point value
*
- * \return Returns a struct containing the fractional and integral parts
+ * \return Returns a struct containing the fractional and integral parts.
*/
MUTILS_API fp_parts_t break_fp(const double value);
diff --git a/src/Global.cpp b/src/Global.cpp
index 2028e69..3466231 100644
--- a/src/Global.cpp
+++ b/src/Global.cpp
@@ -812,8 +812,16 @@ QStringList MUtils::available_codepages(const bool &noAliases)
MUtils::fp_parts_t MUtils::break_fp(const double value)
{
- fp_parts_t result;
- result.fractpart = modf(value, &result.intpart);
+ fp_parts_t result = { };
+ if (_finite(value))
+ {
+ result.parts[1] = modf(value, &result.parts[0]);
+ }
+ else
+ {
+ result.parts[0] = std::numeric_limitsLoading...
+
+
+Searching...
+No Matches
+
+ |