In mathematics, a square root of a number a is a number y such that y^2 = a; in other words, a number y whose square (the result of multiplying the number by itself, or y ⋅ y) is a. For example, 4 and −4 are square roots of 16 because 42 = (−4)2 = 16.
To facilitate this, an Operation would be need to handle processing and returning twodoubles. Each operation would have to decide if it will operate on the double and possibly filter out double.NaN.
I see this as a major overhaul and a major breaking change, and would require a bump in the major version if following semver.
Once that overhaul is complete, it would be trivial to return new Tuple<double, double>(Math.Sqrt(x), -Math.Sqrt(x)) for the Sqrt function operation. ~Alternatively, a new internal model could be passed around that includes the double result as well as a flag that indicates the next operation should be performed on both the result and the negation of the result.~ Edit: This would not work as the next operation may alter the negation result differently and that information would need to be communicated to further operations and eventually the caller.
According to Wikipedia:
To facilitate this, an
Operation
would be need to handle processing and returning twodouble
s. Each operation would have to decide if it will operate on the double and possibly filter outdouble.NaN
.I see this as a major overhaul and a major breaking change, and would require a bump in the major version if following semver.
Once that overhaul is complete, it would be trivial to return
new Tuple<double, double>(Math.Sqrt(x), -Math.Sqrt(x))
for the Sqrt function operation. ~Alternatively, a new internal model could be passed around that includes thedouble
result as well as a flag that indicates the next operation should be performed on both the result and the negation of the result.~ Edit: This would not work as the next operation may alter the negation result differently and that information would need to be communicated to further operations and eventually the caller.Thoughts?