first gui
This commit is contained in:
parent
42737c0a66
commit
c918993060
6 changed files with 1027 additions and 33 deletions
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "constants.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
// ==============================
|
||||
// SIC/XE Utility Functions
|
||||
// ==============================
|
||||
|
|
@ -77,4 +79,17 @@ inline int getCC(int sw) {
|
|||
return sw & CC_MASK;
|
||||
}
|
||||
|
||||
inline double normaliseFloat(double value)
|
||||
{
|
||||
if (value == 0.0 )return 0.0;
|
||||
if (!std::isfinite(value)) return value;
|
||||
double mantissa = value;
|
||||
while (std::fabs(mantissa) >= 10.0) mantissa /= 10.0;
|
||||
while (std::fabs(mantissa) < 1.0) mantissa *= 10.0;
|
||||
return mantissa;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // UTILS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue