This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients eric.smith, jcea, mark.dickinson, python-dev, samuel.iseli, skrah
Date 2012-03-13.14:35:05
SpamBayes Score 1.0772822e-05
Marked as misclassified No
Message-id <20120313143505.GA15416@sleipnir.bytereef.org>
In-reply-to <1331647372.59.0.975659257825.issue13889@psf.upfronthosting.co.za>
Content
Mark Dickinson <report@bugs.python.org> wrote:
> http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx
> Question 1:  when doing __control87_2(new, mask, &old, NULL), does the
> resulting value in old reflect the *new* FPU state or the old one?

The new one, but I had to test that manually (see below).

> Question 2:  in the example near the bottom of that page, there's code like:
> 
>     control_word_x87 = __control87_2(_PC_24, MCW_PC,
>                                      &control_word_x87, 0);
> 
> This looks very odd: we're assigning to control_word_x87, *and* passing it as an output parameter to the call.  Moreover, from the documentation  the return value from __control87_2 is always 1 to indicate success, so I'm not sure why it's being assigned to control_word_x87.
> 
> Am I the only person who's confused by this?

I was confused as well. I'm positive that it's a cut-and-paste bug in the docs:
Probably they had _control87() in that place before, which *does* return the
new control word. As you say, the example above clobbers the value that was set
via the pointer reference, so the result is always 1. :)
History
Date User Action Args
2012-03-13 14:35:06skrahsetrecipients: + skrah, jcea, mark.dickinson, eric.smith, python-dev, samuel.iseli
2012-03-13 14:35:05skrahlinkissue13889 messages
2012-03-13 14:35:05skrahcreate