repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
tcp: Fix 64 bit build with debugging features enabled.
[haiku.git]
/
src
/
preferences
/
screen
/
Utility.cpp
blob
0d20599a1e878349ddc18394bb180cc83c70a85d
1
#include
"Utility.h"
2
#include <math.h>
3
4
float
round
(
float
n
,
int32 max
)
5
{
6
max
= (
int32
)
pow
(
10
, (
float
)
max
);
7
8
n
*=
max
;
9
n
+=
0.5
;
10
11
int32 tmp
= (
int32
)
floor
(
n
);
12
return
(
float
)
tmp
/ (
max
);
13
}