å¹³æ¹æ°ã¨ã¯ãããæ´æ°ã®å¹³æ¹ï¼ï¼äºä¹ï¼ã§ãããããªæ´æ°ã®ãã¨ãè¨ãã¾ããã¤ã¾ãã0,1,4,9,16,...ãå¹³æ¹æ°ã¨ãããã¨ã«ãªãã¾ãã ã¨ããã§ãä¸ããããæ´æ°ãå¹³æ¹æ°ãã©ãããå¤å®ããã«ã¯ã©ãããã°è¯ãã§ãããããä¸ããããæ´æ°ã®å¹³æ¹æ ¹ã®å°æ°ç¹ä»¥ä¸ãåãæ¨ã¦ããããäºä¹ãã¦å ã®æ°ã«ãªããã©ãããã¨ããã®ãããæãã¤ãå®è£ ã§ãã <?php function is_square($n) { $sqrt = floor(sqrt($n)); return ($sqrt*$sqrt == $n); } ããããå¹³æ¹æ ¹ã®è¨ç®ã¯æ¯è¼çéãå¦çã§ãããã£ã¨é«éåããæ¹æ³ã¯ç¡ãã®ã§ããããã å¤åé·æ´æ°æ¼ç®ã©ã¤ãã©ãªGNU MPã«ã¯å¹³æ¹æ°ãã©ãããå¤å®ããmpz_perfect_square_pé¢æ°ãåå¨ãã¾ãï¼PHPã§ãgmp_perfect_squareé¢æ°ã¨ãã¦å©ç¨ã§ãã¾ãï¼ãæ¬ç¨¿ã§ã¯ãã®å®è£
{{#tags}}- {{label}}
{{/tags}}