Skip to content

Commit

Permalink
Added math library
Browse files Browse the repository at this point in the history
  • Loading branch information
zdimension committed Oct 20, 2015
1 parent 0534eb7 commit 6f353f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IMPressive/IMPressive/HComplex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ public HassiumObject Negate(HassiumObject[] args)

public HassiumObject Add(HassiumObject[] args)
{
return new HComplex(args.Select(x => x.HComplex().Value).Sum() + Value);
return new HComplex(Value + args[0].HComplex().Value);
}

public HassiumObject Substract(HassiumObject[] args)
{
return new HComplex(Value - args.Select(x => x.HComplex().Value).Sum());
return new HComplex(Value - args[0].HComplex().Value);
}

public HassiumObject Multiply(HassiumObject[] args)
{
return new HComplex(Value * args.Select(x => x.HComplex().Value).Aggregate(Complex.One, (x, y) => x * y));
return new HComplex(Value * args[0].HComplex().Value);
}

public HassiumObject Divide(HassiumObject[] args)
{
return new HComplex(Value * args.Select(x => 1 / x.HComplex().Value).Aggregate(Complex.One, (x, y) => x * y));
return new HComplex(Value / args[0].HComplex().Value);
}

public Complex Value { get; private set; }
Expand Down
Binary file modified IMPressive/IMPressive/bin/Debug/IMPression.dll
Binary file not shown.

0 comments on commit 6f353f1

Please sign in to comment.