Why ruby modulo is different from java/other lang ?

前端 未结 3 1310
天涯浪人
天涯浪人 2021-01-18 09:42

i am basically coming from java background and struggling to understand the modulo operation in Ruby.

(5 % 3)     
(-5 % 3)    
(5 % -3)    
(-5 % -3) 
         


        
3条回答
提交回复
热议问题