{"ScriptPreparationCode":"const decimalPlaces = 14;\r\n\r\nfunction toFixed(n) {\r\n return Math.round(n * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces);\r\n}\r\n\r\nfunction add(a, b) {\r\n return toFixed(a \u002B b);\r\n}\r\n\r\nfunction subtract(a, b) {\r\n return toFixed(a - b);\r\n}","TestCases":[{"Name":"Native","Code":"var a = 0.1;\r\nvar b = 0.2;\r\n((a \u002B b) * b).toString();\r\n","IsDeferred":false},{"Name":"Native \u002B toFixed","Code":"var a = 0.1;\r\nvar b = 0.2;\r\n((a \u002B b) * b).toFixed(9);\r\n","IsDeferred":false},{"Name":"decimal.js","Code":"var a = new Decimal(\u00220.1\u0022);\r\nvar b = new Decimal(\u00220.2\u0022);\r\na.plus(b).times(b).toString();\r\n","IsDeferred":false},{"Name":"big.js","Code":"var a = new Big(\u00220.1\u0022);\r\nvar b = new Big(\u00220.2\u0022);\r\na.plus(b).mul(b).toString();\r\n","IsDeferred":false},{"Name":"bignumber.js","Code":"var a = new BigNumber(\u00220.1\u0022);\r\nvar b = new BigNumber(\u00220.2\u0022);\r\na.plus(b).multipliedBy(b).toString();\r\n","IsDeferred":false},{"Name":"Option 1","Code":"var a = 0.1;\r\nvar b = 0.2;\r\ntoFixed(toFixed(a \u002B b) * b).toString();","IsDeferred":false}]}