-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
分数で計算できるようにする #18
Comments
オーバーライドする演算子 Fraction operator +(convariant Fraction other) // 通分して足し算
Fraction operator -(convariant Fraction other) // 通分して引き算
Fraction operator *(convariant Fraction other) // 掛け算
Fraction operator /(convariant Fraction other) // 割り算
Fraction operator ==(convariant Fraction other) // 等しいもの
int get hashCode {
var result = 3;
result = 31*result + Numerator;
result = 31*result + Denominator;
} |
記法がいくつか間違えてます。vscodeにでてる青い波線に従って修正してください。 Numerator = (Numerator / gcd).toInt(); // X
Numerator ~/= gcd; // O |
OKです。pull request出しといてください |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
分数クラスを作ってそれでより正確な値を計算できるようにする
The text was updated successfully, but these errors were encountered: