每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis. 每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.
/*Java中没有提供表示有理数的类. 有理数类 */ public class Rational { private long numerator = 0; //分子 private long denominator = 1; //分母 //构造函数 public Rational() { this(0,1); } public Rational(long numerator, long denominator) { long gcd = gcd(numerator,denominator);