[Numpy-tickets] [NumPy] #582: Crash when embedded using Borland Builder 6
NumPy
numpy-tickets@scipy....
Fri Sep 21 05:18:47 CDT 2007
#582: Crash when embedded using Borland Builder 6
------------------------+---------------------------------------------------
Reporter: thomas | Owner: somebody
Type: defect | Status: reopened
Priority: normal | Milestone: 1.0.4 Release
Component: numpy.core | Version: none
Severity: major | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by thomas):
Yes, that does the trick. That was quick!
For the files, uncensored and complete: The current method of
"calculating" infinity relies on the compiler to generate code that
returns infinity on overflows. The Borland C++ Compiler seems to unmask
exception handling for overflows, so this code won't work but throw an
exception instead. If you want to stick to the current code (which should
be perfectly fine), you have to put your FPU into the defined state to not
throw this exception, which can be accomplished by running
_control87(MCW_EM, MCW_EM); beforehand.
Thanks a lot! I hope this patch will make its way into the next release,
so that integrating numpy into bcc applications will be possible without
additional tricks.
By the way, Stefan, about your endianness-question: a nice way to check
for that is to write "1" into the first bit of a multibyte integer and see
whether the integer has the value of 1 afterwards. If so, we hit the least
significant byte (not bit!) and thus we're on little endian. Otherwise we
will get the value of 2^something, so the first byte was the most
significant byte and we're on a big endian machine.
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/582#comment:5>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list