看板 Ruby 關於我們 聯絡資訊
環境: Ruby 1.8.6 狀況: 須要一個可以將小數點後面無條件捨去的功能 其它語言 如 c 或 java 有 floor 的函數可以呼叫 但在 ruby 並且 include Math 後 並沒辦法找到 floor 的 method 或是有其它函數有相同功能?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.170.231.201
poga:(3.14).round 07/21 22:17
poga:(3.14).floor 都可以阿 07/21 22:20
shelary:哦哦..原來是我弄反了..我寫成 floor(3.14) .. 07/21 22:44
shelary:謝謝丫^^" 07/21 22:45
godfat:說到這,我有點不滿為什麼是 sqrt 9 而不是 9.sqrt 07/21 22:57
neomonkey:真的噎...真想知道是什麼原因 08/17 06:50