1.4 KiB
1.4 KiB
id, title, challengeType
id | title | challengeType |
---|---|---|
cf1391c1c11feddfaeb4bdef | Create Decimal Numbers with JavaScript | 1 |
Description
Not all real numbers can accurately be represented in floating point. This can lead to rounding errors. Details Here.
Instructions
myDecimal
and give it a decimal value with a fractional part (e.g. 5.7
).
Tests
tests:
- text: <code>myDecimal</code> should be a number.
testString: 'assert(typeof myDecimal === "number", "<code>myDecimal</code> should be a number.");'
- text: <code>myDecimal</code> should have a decimal point
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
var myDecimal = 9.9;