/ Published in: Ruby
英語ã®ã‚¿ã‚¤ãƒˆãƒ«ãŒé©å½“ãªè‹±è¨³ãªã®ã§ã€èª°ã‹OK/NGã‚’æ•™ãˆã¦ãã ã•ã„。
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# ä»»æ„ã®åº• a ã‚’æŒã¤ x ã®å¯¾æ•°ã‚’計算. def logA( x, a ) return (Math.log(x)/Math.log(a)) end p logA( 2, 2 ) # => 1.0 p logA( 4, 2 ) # => 2.0
URL: http://d.hatena.ne.jp/octech/20080724#1216874092