Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T_ULONG -> double rounding in PyMember_GetOne() #44037

Closed
pjdelport mannequin opened this issue Sep 27, 2006 · 3 comments
Closed

T_ULONG -> double rounding in PyMember_GetOne() #44037

pjdelport mannequin opened this issue Sep 27, 2006 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pjdelport
Copy link
Mannequin

pjdelport mannequin commented Sep 27, 2006

BPO 1566140
Nosy @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2006-10-27.06:19:48.000>
created_at = <Date 2006-09-27.05:23:51.000>
labels = ['interpreter-core']
title = 'T_ULONG -> double rounding in PyMember_GetOne()'
updated_at = <Date 2006-10-27.06:19:48.000>
user = 'https://bugs.python.org/pjdelport'

bugs.python.org fields:

activity = <Date 2006-10-27.06:19:48.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2006-09-27.05:23:51.000>
creator = 'pjdelport'
dependencies = []
files = []
hgrepos = []
issue_num = 1566140
keywords = []
message_count = 3.0
messages = ['30016', '30017', '30018']
nosy_count = 3.0
nosy_names = ['loewis', 'zseil', 'pjdelport']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1566140'
versions = ['Python 2.6']

@pjdelport
Copy link
Mannequin Author

pjdelport mannequin commented Sep 27, 2006

Problem:

Python/structmember.c's PyMember_GetOne currently
handles getting T_ULONG members as follows:

case T_ULONG:
v = PyLong_FromDouble((double) *(unsigned
long*)addr);
break;

On platforms with 64-bit longs, the double won't have
enough precision to hold big values without rounding.

The fix should be simple:

v = PyLong_FromUnsignedLong(*(unsigned long*)addr);

-- Piet Delport <pjd@satori.za.net>

@pjdelport pjdelport mannequin closed this as completed Sep 27, 2006
@pjdelport pjdelport mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 27, 2006
@pjdelport pjdelport mannequin closed this as completed Sep 27, 2006
@pjdelport pjdelport mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 27, 2006
@zseil
Copy link
Mannequin

zseil mannequin commented Sep 27, 2006

Logged In: YES
user_id=1326842

Patch bpo-1549049:
http://www.python.org/sf/1549049

has a fix for this and some other bugs.

@loewis
Copy link
Mannequin

loewis mannequin commented Oct 27, 2006

Logged In: YES
user_id=21627

This was fixed with said patch.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

0 participants