diff --git a/Programming Basics/Summary 1/Exercise 4/task.md b/Programming Basics/Summary 1/Exercise 4/task.md index 59ec23ea..0b3797fd 100644 --- a/Programming Basics/Summary 1/Exercise 4/task.md +++ b/Programming Basics/Summary 1/Exercise 4/task.md @@ -5,3 +5,16 @@ This exercise modifies `Overflow.kt` to test `Long` and `Double`. Implement `testDouble()` display the `Double` maximum value incremented by `1`. Make `testDouble2()` display the result of comparing `Double.MAX_VALUE` and `Double.MAX_VALUE + 1`. + +The `Double` type usually occupies 64 bits in memory. +Because of memory constraints, `Double` represents numbers with some +precision. +You can read more about its internal representation on +[Wikipedia](https://en.wikipedia.org/wiki/Double-precision_floating-point_format). + +The `Double.MAX_VALUE` constant has a special meaning: it holds the largest +positive finite value of `Double`. You can't increase it; if you try to add +a positive number to it, it results in the same maximum value. It works somewhat +similarly to `Double.POSITIVE_INFINITY`: it's a constant with special treatment +holding the positive infinity value of `Double`. You can use these constants +for comparisons with regular `Double` values.