Created
July 12, 2015 07:28
-
-
Save shigemk2/8cd69c0c5e72522b7c9a to your computer and use it in GitHub Desktop.
代数計算 diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/AlgebraCalculation.scala b/AlgebraCalculation.scala | |
| index 691cca8..851311d 100644 | |
| --- a/AlgebraCalculation.scala | |
| +++ b/AlgebraCalculation.scala | |
| @@ -121,7 +121,7 @@ def expand(xs: Expr): Expr = xs match { | |
| case List(x) => List(expand(x)) | |
| case (x::y::xs) => multiply(x,y) :: xs | |
| } | |
| - Mul(f(xs.toList): _*) | |
| + mul(f(xs.toList)) | |
| } | |
| case Add(xs@_*) => { | |
| def f(xs: List[Expr]): List[Expr] = xs match { | |
| @@ -129,7 +129,7 @@ def expand(xs: Expr): Expr = xs match { | |
| case (x::xs) if x != expand(x) => expand(x) :: xs | |
| case (x::xs) if x == expand(x) => x :: f(xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment