http://journal.mycom.co.jp/articles/2007/05/07/mix02/001.html ã¨ã®ãã¨ãªã®ã§ã¡ãã£ã¨å®é¨ãã¦ã¿ã¾ããã ã¾ããç¨æããã®ã¯ä»¥ä¸ã®åå¨çãæ±ããã«ã¼ãã³ããã³ããã¼ã¯ç¨ã«ã«ã¼ãåæ°ãåºå®ãã¦ããã¾ããJavaScriptã§ã¯è¥å¹²å¤æ´ãããã¾ãã double pi() { double pi, ppi; int k = 0; float ek = 0.0; while (k < 1000000) { ppi = pi; ek = 8.0*k; pi += (4/(ek+1) - 2/(ek+4) - 1/(ek+5) - 1/(ek+6)) / pow(16.0, k); k++; } return pi; } ããã§ãã£ã¦æ¬¡ã®ç°å¢ã§å¦çæéãè¨ãã¾ãã MacBook (1.83G)Mac OS X 10.4.9 C (gcc
{{#tags}}- {{label}}
{{/tags}}