1.3 KiB
1.3 KiB
id, challengeType, videoUrl, forumTopicId, localeTitle
id | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|
cf1391c1c11feddfaeb4bdef | 1 | https://scrimba.com/c/ca8GEuW | 16826 | 创建一个小数 |
Description
不是所有的实数都可以用 浮点数 来表示。因为可能存在四舍五入的错误,详情查看。
Instructions
myDecimal
并给它赋值一个浮点数。(例如5.21
)。
Tests
tests:
- text: <code>myDecimal</code>应该是一个数字。
testString: assert(typeof myDecimal === "number");
- text: <code>myDecimal</code>应该包含小数点。
testString: assert(myDecimal % 1 != 0);
Challenge Seed
var ourDecimal = 5.7;
// Only change code below this line
After Test
(function(){if(typeof myDecimal !== "undefined"){return myDecimal;}})();
Solution
var myDecimal = 9.9;