运维网's Archiver
论坛
›
Python
› 整数除法 (integer division in Python and Ruby)
liyeho
发表于 2017-4-29 12:01:07
整数除法 (integer division in Python and Ruby)
Ruby
ruby 代码
[*]require 'mathn'
[*]puts 7/3
得到 7/3
Python
python 代码
[*]from __future__ import division
[*]print 7/3
得到 2.33333333333
我个人更喜欢Ruby的方式
页:
[1]
查看完整版本:
整数除法 (integer division in Python and Ruby)