您最多选择25个主题
主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
474 B
31 行
474 B
// round1().
|
|
|
|
// General includes.
|
|
#include "cl_sysdep.h"
|
|
|
|
// Specification.
|
|
#include "cln/real.h"
|
|
|
|
|
|
// Implementation.
|
|
|
|
#include "cl_R.h"
|
|
#include "cln/rational.h"
|
|
|
|
namespace cln {
|
|
|
|
const cl_I round1 (const cl_R& x, const cl_R& y)
|
|
{
|
|
// Methode:
|
|
// Beides rationale Zahlen -> round1(x,y).
|
|
// Sonst: round1(x/y).
|
|
if (rationalp(x))
|
|
if (rationalp(y)) {
|
|
DeclareType(cl_RA,x);
|
|
DeclareType(cl_RA,y);
|
|
return round1(x,y);
|
|
}
|
|
return round1(x/y);
|
|
}
|
|
|
|
} // namespace cln
|