EsoErik

Tuesday, June 7, 2016

 

Python Built With the Latest Intel C Compiler: Why Does jsonifying a Float Fail?! And, Oh Shit, Oh Shit, Oh Shit, What the Fuck, All My Results Are WRONG!

[01:57 PM][zplab@zpl-iscope:~]> python
Python 3.5.1 (default, May 31 2016, 20:46:24) 
[GCC Intel(R) C++ gcc 6.1.1 mode] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2**39 * 1.596566081047058
877721485311.:

>>>

So, here we have Python 3.5.1 on Arch, built with the Intel C Compiler, version 16.0.3 20160415.  We attempt to multiply two numbers.  The result is represented as the string, "877721485311.:".

Two problems:
  • 877721485311 is not the correct result.
  • "877721485311.:" is not a valid string representation of a floating point number.  jsonifying this nonsense therefore fails horrendously.
[01:59 PM][zplab@zpl-iscope:~/code_repositories]> python
Python 3.5.1 (default, Mar  3 2016, 09:29:07) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2**39 * 1.596566081047058
877721485312.0
>>>

Python built with GCC produces correct results; Python built with a super ultra expensive vendor compiler produces bad results.  Man, this really takes me back...  The last time I dealt with a GCC vs vendor compiler correctness situation on a UNIX-like system was at least 15 years ago, with MIPS Pro, which I had modified to avoid time consuming license checks at each invocation.  After restoring the unmodified version and instead cracking the FlexLM license server (yeah, sorry, as a student, I didn't have $16,995.00 to blow on shit that doesn't even fucking work, and cracking software on IRIX was hilariously easy - the license server was such a piece of junk you could use it from the guest account to overwrite any file on the entire system by manipulating the log path environment variable), the issue remained.  So, the problem really was MIPS Pro, probably.  This time around, in our modern world of bullshit, who even knows or cares?  GCC works.  Into the trash the Intel Compiler goes...

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

July 2009   August 2009   September 2009   October 2009   November 2009   December 2009   January 2010   September 2010   December 2010   January 2011   February 2011   April 2011   June 2011   August 2011   February 2012   June 2012   July 2012   August 2012   October 2012   November 2012   January 2014   April 2014   June 2014   August 2014   September 2014   October 2014   January 2015   March 2015   April 2015   June 2015   November 2015   December 2015   January 2016   June 2016   August 2016   January 2017   March 2017  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]