You are viewing a single comment's thread from:

RE: The Programmer's Challenge of the Day

in #programming7 years ago

Sorry my friend. It's Yes.
Answer is 'YES' and it happens like this because 'a' is in float but 0.7 is by default double so the binary representation of both vary and causes this result to occur.
To get correct result you need to use a < 0.7f : )

For more deeper understanding refer: https://stackoverflow.com/questions/6883306/floating-point-comparison-a-0-7

And remember to upvote and follow please.

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.032
BTC 60972.25
ETH 2632.93
USDT 1.00
SBD 2.57