1.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, forumTopicId, localeTitle
id | title | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|---|
cf1391c1c11feddfaeb4bdef | Create Decimal Numbers with JavaScript | 1 | https://scrimba.com/c/ca8GEuW | 16826 | Создание десятичных чисел с помощью JavaScript |
Description
Не все реальные числа могут быть точно представлены в плавающей точке . Это может привести к ошибкам округления. Подробности здесь .
Instructions
myDecimal
и дайте ей десятичное значение с дробной частью (например, 5.7
).
Tests
tests:
- text: <code>myDecimal</code> should be a number.
testString: assert(typeof myDecimal === "number");
- text: <code>myDecimal</code> should have a decimal point
testString: assert(myDecimal % 1 != 0);
Challenge Seed
var ourDecimal = 5.7;
// Only change code below this line
After Tests
(function(){if(typeof myDecimal !== "undefined"){return myDecimal;}})();
Solution
var myDecimal = 9.9;