support Ruby 1.8.7: remove ruby 1.9 specific syntax, ignore narray for JRuby platform, fix log(num, 2) for ruby 1.8.7