Python Forum
How to verify widening conversion?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to verify widening conversion?
#2
(Apr-08-2023, 03:54 AM)quazirfan Wrote: If the widening is not present in the bytecode - is there another way I can verify it?
By widening, I suppose you mean the conversion from int to float that may occur when the expression 5.0 == 5 is evaluated. In CPython, this is done in the C function float_richcompare() of Objects/floatobject.c in the source tree, see the section that starts with else if (PyLong_Check(w)) {.... This part is rather tricky because Python integers can be arbitrary large.
quazirfan likes this post
Reply


Messages In This Thread
How to verify widening conversion? - by quazirfan - Apr-08-2023, 03:54 AM
RE: How to verify widening conversion? - by Gribouillis - Apr-08-2023, 07:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Verify input as integer and not blank GMCobraz 3 2,175 Jun-22-2020, 02:47 PM
Last Post: pyzyx3qwerty
  How to verify the give number is valid Mekala 3 2,435 May-16-2020, 02:40 PM
Last Post: anbu23
  Unable to verify python versio ThereIsNoSpoom 2 1,826 Jan-15-2020, 09:12 AM
Last Post: DeaD_EyE
  Verify if .docx table of contents is updated as per document sections or not vintysaw 0 3,915 Oct-24-2019, 12:01 PM
Last Post: vintysaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020