With some numbers you can, because the binary representation works, but others like 0.3 have an reputation to be differemt what someone might expect.
If you need precise results, do not use floats or define how precise your numbers need to be and round them to that precision before storing or displaying them
Like a-dab wrote: its impossible
With some numbers you can, because the binary representation works, but others like 0.3 have an reputation to be differemt what someone might expect.
If you need precise results, do not use floats or define how precise your numbers need to be and round them to that precision before storing or displaying them
cast it to an integer and check for equality?
requiring bit identical goes beyond what floats promise though.