Bug #4105
closedBug in numeric.c for Borland compiler
Description
=begin
There is a potential bug in Init_Numeric()
#elif defined(BORLANDC)
/* Turn off floating point exceptions for overflow, etc. */
_control87(MCW_EM, MCW_EM);
#endif
This call wil set the coprocessor in a state that double floating point will become single float when an exception is thrown
See http://qc.embarcadero.com/wc/qcmain.aspx?d=32483 for the workaround.
The next code should eleminate this
#elif defined(BORLANDC)
/* Turn off floating point exceptions for overflow, etc. */
_control87(MCW_EM, MCW_EM);
_control87(_control87(0,0),0x1FFF);
#endif
This will only appear when borland and for example microsoft dll's are mixed.
This can happend when OpenGl dll's are used
Btw. This source is also present in 1.8
I found this problem because I created a borland dll calling the ruby mswin32 version dll
It generated strange errors. A 'puts 0.0' generated a devide by zero in the ruby sprintf implementation
Putting the two _control87 calls in my dll solved this.
I found the same construction in the Ruby source without the second _control87 call :-)
=end
Updated by kosaki (Motohiro KOSAKI) almost 14 years ago
=begin
This will only appear when borland and for example microsoft dll's are mixed.
This can happend when OpenGl dll's are usedBtw. This source is also present in 1.8
I found this problem because I created a borland dll calling the ruby mswin32 version dll
It generated strange errors. A 'puts 0.0' generated a devide by zero in the ruby sprintf implementation
Putting the two _control87 calls in my dll solved this.
I found the same construction in the Ruby source without the second _control87 call :-)
Hi
Can you please consider to send a patch? I don't think mainainers have
borland compiler. ;)
=end
Updated by usa (Usaku NAKAMURA) almost 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r29998.
W, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end