On Tue, Aug 26, 2025, at 9:30 AM, Tim Düsterhus wrote:

> For `is_representable_as_int()` finding a reasonable definition is much 
> easier, but I don't think I've ever had a use case where I needed to 
> know whether a non-integer value is exactly representable as an int.
>
> Long story short: What actual real-world problem does this RFC attempt 
> to solve? The list in the “Introduction” section is not particularly 
> meaningful with regard to the real world and the JSON example is wrong 
> as outlined above.
>
> Best regards
> Tim Düsterhus

I have multiple times just recently had need of "I have a numeric string, 
should I cast it to an int or a float?", for which an is_representable_as_int() 
function (or similar) would be quite helpful, and neater than the messy 
solution I usually use.

I haven't had a use for is_representable_as_float() that I can recall.

--Larry Garfield

Reply via email to