2012年6月24日日曜日

開発環境

『Learning Ruby』(Michael Fitzgerald 著、O'Reilly Media、2007年、ISBN978-0-596-52986-4)の Chapter 5(Math)Review Questions 7を解いてみる。

その他参考書籍

7.

Math::E, Math::PI

コード(TextWrangler)

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

puts Math.constants
puts "π = #{Math::PI}"
puts "e = #{Math::E}"

入出力結果(Terminal)

$ ./sample.rb
E
PI
π = 3.14159265358979
e = 2.71828182845905
$

0 コメント:

コメントを投稿