I was thinking that it should be possible to add a short explanation when closing as a duplicate.
Look at this question about strange result from long long n = pow(10,18) + 1
in C. The core reason for the unexpected behavior is that floats behave differently than integers, which is covered very well in the canonical question Is floating point math broken?
However, there is one small piece of information that is needed to tie them together, and that is that pow()
returns a floating number.
My current options are these.
Close as dup and add a comment about it. It has two main drawbacks. 1) The information will be in the comment section, pretty far from the link to the dup and 2) Comments may disappear at any time
Find or create a question that explains the return type of
pow()
and close as dup of both of them. This is a good approach sometimes, but in this case, I think it's overkill.Answer it with something like this "The function
pow()
returns a double, which is a floating point number, and not an integer. The rest is explained here Is floating point math broken? " and then close as a dup. But this does not feel right.
I would suggest the possibility to add a small comment explaining why the dup is a dup, so that the dup box would look like this, with my addition emphasized:
This question already has answers here:
Is floating point math broken? (31 answers) - (The function pow returns a float)
That way, the explanation is available right where it's needed. And a clarification from comments below. I mean that anyone who can edit the dup list also can edit this comment.
Note: This is NOT a dup of Should we add more explanation when closing as duplicate? which covers a different thing