Tag: pi

60 votes
3 answers
2.7K views
Possible GCC bug when returning struct from a function

I believe I found a bug in GCC while implementing O'Neill's PCG PRNG. (Initial code on Godbolt'

avatar
Vi
0 1 0 9
asked 07 September, 2021
50 votes
3 answers
1.8K views
Why does GCC generate such radically different assembly for nearly the same C code?

While writing an optimized ftol function I found some very odd behaviour in GCC 4.6.1. Let me show you the cod

avatar
Eddie
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
652 views
Is it possible to "decompile" a Windows .exe? Or at least view the Assembly?

A friend of mine downloaded some malware from Facebook, and I'm curious to see what it does without infec

avatar
Rudy
0 1 0 9
asked 07 September, 2021
63 votes
5 answers
1.7K views
Why does Java switch on contiguous ints appear to run faster with added cases?

I am working on some Java code which needs to be highly optimized as it will run in hot functions that are inv

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
64 votes
11 answers
1.9K views
Replacing a 32-bit loop counter with 64-bit introduces crazy performance deviations with _mm_popcnt_u64 on Intel CPUs

I was looking for the fastest way to popcount large arrays of data. I encountered a very weird effect: Changin

avatar
Daniel
0 1 0 9
asked 07 September, 2021
58 votes
12 answers
923 views
Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)?

I am doing some numerical optimization on a scientific application. One thing I noticed is that GCC will optim

avatar
Venice
0 1 0 9
asked 07 September, 2021
52 votes
3 answers
1.1K views
Why does Python's hash of infinity have the digits of π?

The hash of infinity in Python has digits matching pi: >>> inf = float('inf') >>>

avatar
Xavier
0 1 0 9
asked 07 September, 2021
48 votes
19 answers
452 views
Mapping two integers to one, in a unique and deterministic way

Imagine two positive integers A and B. I want to combine these two into a single integer C. There can be no

avatar
Benton
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.2K views
How do I determine whether my calculation of pi is accurate?

I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Tayl

avatar
Hilario
0 1 0 9
asked 07 September, 2021
58 votes
9 answers
1.9K views
How to state in requirements.txt a direct github source

I've installed a library using the command pip install git+git://github.com/mozilla/elasticutils.git whi

avatar
Keila
0 1 0 9
asked 07 September, 2021
55 votes
12 answers
840 views
How to git-cherry-pick only changes to certain files?

If I want to merge into a Git branch the changes made only to some of the files changed in a particular commit

avatar
Kisha
0 1 0 9
asked 07 September, 2021
57 votes
13 answers
1.3K views
Error "The input device is not a TTY"

I am running the following command from my Jenkinsfile. However, I get the error "The input device is not a TT

avatar
Lynette
0 1 0 9
asked 07 September, 2021
54 votes
9 answers
2.1K views
How to force Docker for a clean build of an image

I have build a Docker image from a Docker file using the below command. $ docker build -t u12_core -f u12_cor

avatar
Santiago
0 1 0 9
asked 07 September, 2021
61 votes
11 answers
513 views
Installing specific package versions with pip

I'm trying to install version 1.2.2 of the MySQL_python adaptor, using a fresh virtualenv created with th

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
53 votes
12 answers
1.3K views
What does cherry-picking a commit with Git mean?

Recently, I have been asked to cherry-pick a commit. So what does cherry-picking a commit in git mean? How d

avatar
Solomon
0 1 0 9
asked 07 September, 2021
61 votes
2 answers
2.7K views
Testing NativeScript app with Appium

I am learning NativeScript. I am trying to write some automated tests with Jasmine. From my understanding, I c

avatar
Alba
0 1 0 9
asked 07 September, 2021
62 votes
6 answers
2.3K views
How to set the DPI of Java Swing apps on Windows/Linux?

If you have an monitor with a DPI over 150 (such as Macbook Pro), you may also find the problem: the font on t

avatar
Fabian
0 1 0 9
asked 07 September, 2021
52 votes
9 answers
741 views
Openstreetmap: embedding map in webpage (like Google Maps)

Is there a way to embed/mashup the OpenStreetMap in your page (like the way Google Maps API works)? I need to

avatar
Winford
0 1 0 9
asked 07 September, 2021
60 votes
4 answers
402 views
How to interpret API documentation function parameters?

Is there a standard to interpret the syntax of function interfaces in API documentations and if yes, how is it

avatar
Don
0 1 0 9
asked 07 September, 2021
61 votes
3 answers
1.3K views
Reading header data in Ruby on Rails

I am making an API where in the access token for Facebook login will be sent in through header data. How do I

avatar
Joseph
0 1 0 9
asked 07 September, 2021