(-1).div(2.0)

(-1).div(2.0) e$B$,e(B 0 e$B$K$J$j$^$9!#e(B

% ./ruby -ve ‘p((-1).div(2.0))’
ruby 1.9.0 (2008-05-02 revision 16277) [i686-linux]
0

e$B$7$+$7!"e(B(-1).divmod(2.0) e$B$de(B (-1).div(2)
e$B$HHf3S$9$k$H!"e(B-1 e$B$,e(B
e$BE,@Z$J$s$8$c$J$$$G$7$g$&$+!#e(B

% ./ruby -e ‘p((-1).divmod(2.0))’
[-1, 1.0]
% ./ruby -e ‘p((-1).div(2))’
-1
% ./ruby -v
ruby 1.9.0 (2008-05-02 revision 16277) [i686-linux]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs