![]() |
![]() |
4118 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Operations | |||||||
The result of an integer division operation is being cast to a floating type. This division operation will be performed in integer arithmetic and so any remainder will be discarded. Don't be confused into thinking that the division is conducted in a floating type just because the result is being cast to a floating type. For example:
/*PRQA S 584,3198,3227,3408,3447 ++*/
extern float ft;
void foo(unsigned int m, unsigned int n)
{
ft = m / n; /* Message 4117 + 3774 (implicit conversion, int to float) */
ft = (float)(m / n); /* Message 4118 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |