4 ms·
> 1 == 1.0, # false, int and float are always distinct. Uh?? If int and floats are always distinct then you should disallow int and float comparison (panic) in
by renox 4y ago
> 1 == 1.0, # false, int and float are always distinct.
Uh?? If int and floats are always distinct then you should disallow int and float comparison (panic) instead of allowing it and always returning false!
That said it is probably a good idea to disable comparison for floats algother: maybe == would be int&bool&string only but for floats there would be ~= (approximate relative equality) but of course the issue is that not everybody will agree on the correct percentage tolerated for equality: 0.1%, less?
And still in https://hush-shell.github.io/intro/basic-constructs.html https://hush-shell.github.io/intro/basic-constructs.html , the example ( # this would cause a panic:
# let x = array[5] ) is probably wrong now: 5 is a valid index in the array..