You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/vendor/bundle/ruby/4.0.0/gems/bigdecimal-4.1.0/sample/pi.rb

17 lines
291 B

#
# pi.rb
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle)
#
require "bigdecimal"
require "bigdecimal/math.rb"
if ARGV.size == 1
print "PI("+ARGV[0]+"):\n"
p BigMath.PI(ARGV[0].to_i)
else
print "TRY: ruby pi.rb 1000 \n"
end