torsdag 10 juli 2014

Floating point numbers ...

Floating point numbers have some unexpected properties.

Try this in your favourite language (if it has real floats)

Python:
>>> print 0.1 + 0.2 == 0.3
False
 C:
#include <stdio.h>
int main() {  printf("%s\n", 0.1 + 0.2 == 0.3 ? "True" : "False");

$ gcc float.c -o float && ./float 
False 



fredag 4 juli 2014

Installing a specific branch of a python package with pip



pip install --user 'git+git://github.com/llvmpy/llvmpy@llvm-3.4'