Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
c
d
e
f
g
i
k
l
m
n
p
q
r
s
t
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Classes
Class List
Class Hierarchy
Class Members
All
!
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
!
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
f
k
l
m
n
o
p
r
s
t
v
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
:
a
b
c
d
e
g
h
i
l
m
n
o
p
r
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
x
z
Enumerations
Enumerator
c
e
f
g
i
l
m
n
o
p
r
s
t
u
v
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
gtsam
3rdparty
cephes
cephes
round.c
Go to the documentation of this file.
1
/* round.c
2
*
3
* Round double to nearest or even integer valued double
4
*
5
*
6
*
7
* SYNOPSIS:
8
*
9
* double x, y, round();
10
*
11
* y = round(x);
12
*
13
*
14
*
15
* DESCRIPTION:
16
*
17
* Returns the nearest integer to x as a double precision
18
* floating point result. If x ends in 0.5 exactly, the
19
* nearest even integer is chosen.
20
*
21
*
22
*
23
* ACCURACY:
24
*
25
* If x is greater than 1/(2*MACHEP), its closest machine
26
* representation is already an integer, so rounding does
27
* not change it.
28
*/
29
30
/*
31
* Cephes Math Library Release 2.1: January, 1989
32
* Copyright 1984, 1987, 1989 by Stephen L. Moshier
33
* Direct inquiries to 30 Frost Street, Cambridge, MA 02140
34
*/
35
36
#include "
mconf.h
"
37
38
double
round
(
double
x
)
39
{
40
double
y
, r;
41
42
/* Largest integer <= x */
43
y
=
floor
(
x
);
44
45
/* Fractional part */
46
r =
x
-
y
;
47
48
/* Round up to nearest. */
49
if
(r > 0.5)
50
goto
rndup;
51
52
/* Round to even */
53
if
(r == 0.5) {
54
r =
y
- 2.0 *
floor
(0.5 *
y
);
55
if
(r == 1.0) {
56
rndup:
57
y
+= 1.0;
58
}
59
}
60
61
/* Else round down. */
62
return
(
y
);
63
}
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition:
gnuplot_common_settings.hh:12
round
double round(double x)
Definition:
round.c:38
y
Scalar * y
Definition:
level1_cplx_impl.h:124
mconf.h
floor
const EIGEN_DEVICE_FUNC FloorReturnType floor() const
Definition:
ArrayCwiseUnaryOps.h:481
gtsam
Author(s):
autogenerated on Wed Jan 1 2025 04:03:06