Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> How do you get all values in say in 0..9.9999 when using 0 <= x <= 9... it makes sense to use 0 <= x < 10...

This breaks down for negatives, though. -9.9999..0 would be -10 < x <= 0.



It's just fine for negatives. If you slide the range that 'makes sense' back by 10 (add -10 to it):

-10 <= x < 0

This excludes the end of the range, it includes the start of the range. What's changed is that the start of the range is no longer at zero and also has crossed from positive to negative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: