To Explain my question in a better I want to know the nearest integer less than the given value. Now this value is of double type...So there are two cases
- if value contains decimal part that is if value is
6.8
the answer would be6
- if value is already integer than the answer should be one less that is if value is
6
then answer would be5
Now simply taking floor would not apply to the second case
So I tried this ceil(value-1)
but here again I encountered a problem that is when value was 0.3
it should output 0
but it was outputting -0
(negative zero).
So what is the best way to implement this?