ã¯ããã« éèãä¼è¨çã®é«ç²¾åº¦ãããå ´åã«Pythonã§ã¯Decimalã®å©ç¨ã好ã¾ããã®ã§ãããç¨éæ ã«å©ç¨é »åº¦ãããã¾ã§é«ããªããå®éã«ä½¿ã£ã¦ã¿ãã¨æ £ããªããã¡ã¯ã¢ã¸ã¥ã¼ã«ã®åä½ã«æ¯ãåããããããªæè¦ã«é¥ãã¾ãã ç´ä¸ã¶æç¨åº¦Decimalã«æ¯ãåããã¤ã¤ãã©ã®ããã«æ±ãã°ããã®ãå¤ã£ã¦ããç¯å²ã§ã¾ã¨ãã¦ã¿ã¾ããã Decimalã使ãã¹ãã·ã¼ã³ æµ®åå°æ°ç¹ã交ããæ°å¤åã³è¨ç®ã対象ã§ããfloatåã§ã¯æ£ç¢ºã«è¨ç®ã§ããªãã±ã¼ã¹ã«ã対å¿ã§ãã¾ãã >>> float('0.3') - float('0.2') 0.09999999999999998 >>> from decimal import Decimal >>> Decimal('0.3') - Decimal('0.2') Decimal('0.1') Decimalã«æ¸¡ãå¤ã¯æååã«ãã¹ãã¨ããç¹ã ãæ°ãã¤ãã¾ããããfl
{{#tags}}- {{label}}
{{/tags}}