hi all, i want to cut off digits after point in float no.
ex.
1.245
should be
1.2
hi all, i want to cut off digits after point in float no.
ex.
1.245
should be
1.2
Is this when you read them in, or when you print them out?
Because you can't do it with the internal representation since floats are approximations. You're always going to end up with say 1.200001 or 1.199999 as being the nearest representable value.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i want them to come while printing
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
thanks