]> www.ginac.de Git - cln.git/blob - src/real/division/cl_R_fround12.cc
6562bad4195d12c595324197873a5c01f6b40906
[cln.git] / src / real / division / cl_R_fround12.cc
1 // fround().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_real.h"
8
9
10 // Implementation.
11
12 #include "cl_R.h"
13
14 const cl_F fround (const cl_R& x, const cl_R& y)
15 {
16 // Methode:
17 // x,y beide rational: round(x,y), Quotienten in Float umwandeln.
18 // Sonst: fround(x/y).
19         if (rationalp(x))
20                 if (rationalp(y)) {
21                         // beides rationale Zahlen
22                         DeclareType(cl_RA,x);
23                         DeclareType(cl_RA,y);
24                         return cl_float(round1(x,y));
25                 }
26         return fround(x/y);
27 }