From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9v?= =?ISO-8859-1?Q?ue?=) Date: 2007-11-22T17:40:04+09:00 Subject: syntax Float equality within epsilon i need to test float numbers within an epsilon, then i've extended the Float clas like that : class Float def ===( aFloat, eps = 1.0e-10) begin clazz = aFloat.class.to_s raise "Argument \"#{aFloat}\" must be a Float (being of #{clazz})." if clazz != "Float" ( self > aFloat - eps ) && ( self < aFloat + eps ) rescue puts "An error occurred: #{$!}" nil end end end this works as expected except when i want not to use the default value for eps where i couldn't find the correct syntax : a = 1.000000001 b = 1.00000000012 p ( a ===( b, 0.001) ).to_s gave me : [...] syntax error, unexpected ')', expecting tCOLON2 or '[' or '.' p ( a ===( b, 0.001) ).to_s ^ why ??? -- Une B�vue