Skip to main content
Paul Chernoch's user avatar
Paul Chernoch's user avatar
Paul Chernoch's user avatar
Paul Chernoch
  • Member for 9 years, 8 months
  • Last seen more than 1 year ago
  • Massachusetts
awarded
comment
How do I handle disagreement in a code review regarding an unlikely edge case?
I work in an agile environment. My approach would be to argue the unlikelihood of the case being found in practice, propose that we document the case in the code, add a technical debt story to the backlog to create the unit test and modify the code to handle the case and let management decide how to prioritize it relative to other things that need to get done. Changing the conversation from DO/NOT DO to DO NOW/DO LATER might make everyone happier.
comment
Why are floating point numbers used often in Science/Engineering?
You can support arbitrary precision arithmetic (add, multiply, subtract, divide), irrationals (like √2), well known transcendentals (like Pi and e), trig functions, etc. using continued fractions. See Gosper's algorithm in HAKMEM. When finished, you can perform lazy evaluation to get a floating point approximation to the desired precision.
comment
Why are floating point numbers used often in Science/Engineering?
@CharlesE.Grant - We can represent many real numbers exactly, using continued fractions and lazy algorithms that can deliver any desired degree of precision. See Gosper's algorithm for arithmetic using continued fractions. Numbers like Pi, e, sqrt(2), etc. can be manipulated exactly. Results of functions like log and tangent as well.
awarded
awarded
Loading…