Decimal places in RGBA values of Python-generated image?
Images are usually created and packed as PNGs as 8-bit sRGB format. This severely limits the precision of the RGBA values stored. To improve precision you need to force the image to be stored in a format that supports 32-bit float channels such as EXR format.

To use a simple example, storing as an 8-bit image would be limited to steps of 1/256 or approximately 0.0039 - any value below around 0.002 would be rounded down to zero and any value from 0.002 to around 0.006 would be rounded to 0.004 (or 00000001 in binary). The actual values used for each 'step' is further complicated by the sRGB color conversion (which stretches the color space in order to produce a more practical range of colors for display on a screen - see Wikipedia sRGB

Examples of storing images in 32-bit float EXR format can be found in Creating and packing a 32-bit float image and Capture object properties to use in a Cycles material