From: DaVinci Date: 2001-08-29T23:01:36+09:00 Subject: [ruby-talk:20524] Problem with float numbers Hello. I have found a rare problem with float numbers. It only raises when I use Gtk extension (or so I think). I have made tests with irb: > puts 2.6 * 2 5.2 nil > That's ok. But now try to execute next example: ---------------------------------------------------- #!/usr/bin/ruby require 'gtk' class Main def initialize @win = Gtk::Window.new @win.signal_connect('destroy') do Gtk::main_quit end @cont = Gtk::VBox.new(false, 5) @win.add(@cont) @caja = Gtk::HBox.new @cont.pack_end(@caja) boton1 = Gtk::Button.new('Hello') @caja.pack_start(boton1) boton1.signal_connect("clicked") do puts 2.6 * 2 end @win.show_all end end Main.new Gtk.main ------------------------------------------ output when you click button is: 5,6.0 !!!!!!!!!!! What is the problem? I have found other float/gtk related problems with more complex code (It is boring to reproduce here). Same line poduces in that case a result of: 4.0 like if it was an integer product (!!!!!!!!). Is this a float bug?... Thanks. David