Bifalgorithm post · Computer science one · Quadratic Roots
How can the return value communicate errors when roots are passed by reference?
How can the return value communicate errors when roots are passed by reference? (Computer science one · Quadratic Roots) — "We also note that the return value…
Ideas in this flowchart
- The return value is available for communicating errors
- The roots are returned through two pass-by-reference variables
- Therefore, the function's return value is not needed for returning the roots
- The return value can instead communicate errors to the calling function
- Several inputs may be invalid
- The roots could be complex values
- The coefficient a could be zero
- The pointers could be invalid because they point to NULL
- The next chapter examines how different errors can be communicated and handled by the calling function