in reply to Re: Maintain accuracy of floating point numbers in simple arithmetic operation
in thread Maintain accuracy of floating point numbers in simple arithmetic operation
I must admit your solution takes the form of a brain teaser for me. I'll limit my query to the first thing that I can't figure out off the top of my head, which is why the + after the first set of parens? Isn't it redundant, given the + after the \d within?
In general, IMHO, I think an explanation of your solution would be helpful not only to me, but to others who may come across this thread, especially in the future, perhaps from a search.
EDIT: I guess what I don't understand is
EDIT 2: I see now that the test is not for definedness, but for 0, because you don't want to make 0.779999% become 077.9999.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Maintain accuracy of floating point numbers in simple arithmetic operation
by BrowserUk (Patriarch) on Jun 13, 2007 at 16:44 UTC | |
|
Re^3: Maintain accuracy of floating point numbers in simple arithmetic operation
by BrowserUk (Patriarch) on Jun 13, 2007 at 19:10 UTC |