Cast from int32 to float32 changes the value.
## Change the float32 to float64 to keep the value same
>>> tf.cast(tf.constant(52479843, tf.int32), tf.float64)
<tf.Tensor: shape=(), dtype=float64, numpy=52479843.0>
## same for this one too
>>> tf.cast(tf.constant(52479845, tf.int32), tf.float64)
<tf.Tensor: shape=(), dtype=float64, numpy=52479845.0> @BMMevius Changing the float32 to float64 would give the same result in casting.  
 Please have a look at this [gist](https://colab.research.google.com/gist/sushreebarsa/0b30b3321838a98226cdd27448670b29/61875.ipynb). As per [this](https://github.com/tensorflow/tensorflow/blob/v2.13.0/tensorflow/python/ops/math_ops.py#L938-L1019) documentation, the operation supports data types (for `x` and `dtype`) of
  `uint8`, `uint16`, `uint32`, `uint64`, `int8`, `int16`, `int32`, `int64`,
  `float16`, `float32`, `float64`, `complex64`, `complex128`, `bfloat16`.
  In case of casting from complex types (`complex64`, `complex128`) to real
  types, only the real part of `x` is returned.

```
tf.cast(tf.constant(52479843, tf.int32), tf.float64)
<tf.Tensor: shape=(), dtype=float64, numpy=52479843.0>


```
```
tf.cast(tf.constant(52479845, tf.int32), tf.float64)
<tf.Tensor: shape=(), dtype=float64, numpy=52479845.0>
```

Thank you! I see that the documentation states that there is a loss of precision when converting from a python datatype to a tensorflow datatype but it also happens when converting from a `tf.int32` to a `tf.float32`, which was not indicated by the documentation.
If there is a loss in precision between certain tf types, which I believe is going on, it might be useful to add that to the documentation as well. @BMMevius Thank you for your response here. Could you please confirm if the original issue has been resolved.
Thank you!  The issues has not been resolved. Because the documentation is not complete about this precision issue. This is the standard limitation of floating point precision.

In IEEE 754 single precision (float), there are 23 bits allocated for the mantissa, allowing for approximately 7 decimal digits of precision.

Due to this finite precision, not all real numbers can be represented exactly in the floating-point format. This limitation leads to rounding errors or inaccuracies in calculations, especially when dealing with numbers that require more precision than what can be represented within the given number of bits.

For more detail, visit https://en.wikipedia.org/wiki/IEEE_754  This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61875">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61875">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

binary

### TensorFlow version

2.12.0 through tf-nightly (v1.12.1-99894-g5bef7ce6955 2.15.0-dev20230915)

### Custom code

Yes

### OS platform and distribution

nvcr.io/nvidia/tensorflow:23.07-tf2-py3 docker image

### Mobile device

_No response_

### Python version

3.10.6

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Casting some int32 values to float32 causes a change in value.

### Standalone code to reproduce the issue

```shell
>>> tf.cast(tf.constant(52479843, tf.int32), tf.float32)
<tf.Tensor: shape=(), dtype=float32, numpy=52479844.0>
>>> tf.cast(tf.constant(52479845, tf.int32), tf.float32)
<tf.Tensor: shape=(), dtype=float32, numpy=52479844.0>
```
```


### Relevant log output

_No response_