16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-09-01 13:59:19 +02:00

Poprawione obliczanie zmiennych zmiennoprzecinkowych

This commit is contained in:
firleju
2017-01-07 21:54:30 +01:00
parent 95f8bd3c27
commit 64ae28decc
4 changed files with 119 additions and 125 deletions

View File

@@ -59,7 +59,16 @@ int Min0(int x1, int x2);
double Max0R(double x1, double x2);
double Min0R(double x1, double x2);
int Sign(double x);
inline int Sign(int x)
{
return x >= 0 ? 1 : -1;
}
inline double Sign(double x)
{
return x >= 0 ? 1.0 : -1.0;
}
inline long Round(float f)
{
return (long)(f + 0.5);