Message155617
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. :) |
|
Date |
User |
Action |
Args |
2012-03-13 14:35:06 | skrah | set | recipients:
+ skrah, jcea, mark.dickinson, eric.smith, python-dev, samuel.iseli |
2012-03-13 14:35:05 | skrah | link | issue13889 messages |
2012-03-13 14:35:05 | skrah | create | |
|