Talk:24 game: Difference between revisions

→‎Floating point: Try 3 3 8 8 in Tcl?
(→‎Floating point: Try 3 3 8 8 in Tcl?)
Line 35:
0.0</lang>Despite a definitely non-representable intermediate (I know the implementation) the answer is exact. I just can't trigger the problem for anything that might be a solution. (Non-solutions… who cares about them?) Rationals might be theoretically better, but IEEE double seems good enough here. –[[User:Dkf|Donal Fellows]] 13:32, 8 December 2009 (UTC)
::: You mentioned in [[Talk:24_game_Player#Should_we_enumerate_all_solutions.3F]] that it was practicable to identify all 7,860 solutions. That sounds like a pretty small test set. (Or am I misunderstanding your description of the enumeration?) --[[User:Short Circuit|Michael Mol]] 18:49, 8 December 2009 (UTC)
 
::: Hi Donal, you might try [[Talk:24_game_Player#Use_3_3_8_8_in_example_runs.3F|3 3 8 8]] in the TCL example. Floating point won't work for this in Python. --[[User:Paddy3118|Paddy3118]] 14:18, 15 February 2011 (UTC)
 
:One potential problem with floating point, when you get to more than 4 digits, is that in some languages (not Python), division by 0.0 evaluates to infinity (which can be divided by again to get 0), instead of raising an error, so for example, this in Ruby: <code>3.0 * (8.0 + 4.0 / (2.0 / (5.0 - 5.0)))</code> results in 24.0, which you might not want to allow. But I agree that this is not an issue with only 4 digits. --[[User:Spoon!|Spoon!]] 14:16, 8 December 2009 (UTC)
Anonymous user