Talk:Approximate equality: Difference between revisions

m
 
(4 intermediate revisions by the same user not shown)
Line 6:
I would like to change this test case to involve numbers a few binary orders of magnitude less (to give room for languages with slightly smaller floats) and perhaps also include a test-case for 32-bit and/or 16-bit floats, in order to force implementations in any language to allow for differences in magnitude, but the fact that this would invalidate many existing solutions may be an issue. Perhaps the existing solutions which operate only on an absolute difference between numbers could be moved to a different page? [[User:Goose121|Goose121]] ([[User talk:Goose121|talk]]) 00:04, 20 November 2021 (UTC)
 
:I made a minor grammatical adjustment to youyour post which made it clearer to me, says x ==> implies "x".
:It (now) strikes me the third case should really have had two 1 on the rhs, then it would be a blatent error if test 1 and test 3 gave different results.
:<small>(Clearly the Java/Lua entries should be given some sort of special prize for getting cases 3, 4, 6, ''and'' 7 wrong!)</small>
:The tests should have expected results explicitly stated, that is beyond 1 and 2, "Otherwise answers may vary and still be correct." is an absolute cop-out if ever I saw one.
:A consistent output should be specified (maybe like R), I quite like the idea of "==" and "~=" columns. I could go on.
:You should write a list here of any further tests you'd like to see.
:Remember all this is really much more "compare languages" as opposed to "write a useful function", I guess.
:Marking existing answers as needing review is not unprecedented, but needs 4 or 5 "ayes" here --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 13:51, 20 November 2021 (UTC)
 
7,803

edits