1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
cf1391c1c11feddfaeb4bdef | Create Decimal Numbers with JavaScript | 1 | 使用JavaScript创建十进制数 |
Description
并非所有实数都可以准确地以浮点表示。这可能导致舍入错误。 细节在这里 。
Instructions
myDecimal
并给它一个带小数部分的十进制值(例如5.7
)。 Tests
tests:
- text: <code>myDecimal</code>应该是一个数字。
testString: 'assert(typeof myDecimal === "number", "<code>myDecimal</code> should be a number.");'
- text: <code>myDecimal</code>应该有一个小数点
testString: 'assert(myDecimal % 1 != 0, "<code>myDecimal</code> should have a decimal point"); '
Challenge Seed
var ourDecimal = 5.7;
// Only change code below this line
After Test
console.info('after the test');
Solution
// solution required