A
amit.codename13
from the c99 standard
6.3.1.4
When a value of integer type is converted to a real floating type,
if the value being
converted can be represented exactly in the new type, it is unchanged.
If the value being
converted is in the range of values that can be represented but cannot
be represented exactly, the result is either the nearest higher or
nearest lower representable value, chosen
in an implementation-defined manner. If the value being converted is
outside the range of
values that can be represented, the behavior is undefined.
since it says about a situation in which "value being converted can be
represented exactly in the new type" but does not say anything about
the requirements for it to be represented then it may mean that
sometimes the value can be represented and sometimes not???
why should anything like this be stated "if the value being converted
can be represented exactly in the new type"
6.3.1.4
When a value of integer type is converted to a real floating type,
if the value being
converted can be represented exactly in the new type, it is unchanged.
If the value being
converted is in the range of values that can be represented but cannot
be represented exactly, the result is either the nearest higher or
nearest lower representable value, chosen
in an implementation-defined manner. If the value being converted is
outside the range of
values that can be represented, the behavior is undefined.
since it says about a situation in which "value being converted can be
represented exactly in the new type" but does not say anything about
the requirements for it to be represented then it may mean that
sometimes the value can be represented and sometimes not???
why should anything like this be stated "if the value being converted
can be represented exactly in the new type"