08-08-2017 11:25 AM
Unlike the last question, this one should be common knowledge for everybody.
QUESTION: Find a value that will cause the boolean to be TRUE when the code is executed.
08-08-2017 11:36 AM
This one is too easy
08-09-2017 05:41 AM
answer:
08-09-2017 08:01 AM
@jwscs wrote:
answer:
Spoilermight this be a trick question?
i know that you cannot guarantee x + (y+z) == (x+y)+z for floating points,
but to compare the same number/bit-representation against each other should never be different.
If you look at the definition of floating point numbers, there is a case where it SHOULD be different.
That condition is what Christian is trying to teach us about with this trivia question.
Ben
08-09-2017 08:54 AM - edited 08-09-2017 09:02 AM
ok found it...
08-30-2017 04:24 PM
My first guess was either +inf or -inf. Interestingly enough, this returns false. I guess you could prove that a double precision float is countably infinite...
08-31-2017 10:03 AM
@BownM i must disagree with you, since you only have a finite number of bytes for the representation, it follows, that there can only be a finite number of different numbers.
08-31-2017 12:28 PM
09-04-2017 03:49 AM
@jwscs wrote:
@BownM i must disagree with you, since you only have a finite number of bytes for the representation, it follows, that there can only be a finite number of different numbers.
Approximately 18.4*10^18 unique combinations. 🙂
/Y
09-07-2017 08:57 PM
input value:NAN