Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 18.188.250.166
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : pi.rb
#!/usr/local/bin/ruby
# frozen_string_literal: false

#
# pi.rb
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#

require "bigdecimal"
require "bigdecimal/math.rb"

include BigMath

if ARGV.size == 1
    print "PI("+ARGV[0]+"):\n"
    p PI(ARGV[0].to_i)
else
    print "TRY: ruby pi.rb 1000 \n"
end
© 2025 GrazzMean-Shell