What is this?

This is a list of git aliases (shortcuts) to use git more efficiently. I get this valuable git config from my lovely manager Mike Veldink from Siemens AG, a special thanks to him. You can just paste this into git shell.

Let's say you have a board (beaglebone, raspberry pi, etc) and you want to connect internet by using a proxy server. Your work network may not allow this little guy or you may be in a closed-network with one gateway -- proxy.

Use system-wide proxy

First, let's see how to configure system-wide proxy in linux. Most programs honor http_proxy environmental variable. Let's add them permanently in the system.

Floating point is less than FLT_MIN, double is less than DBL_MIN. How is it possible?

Looking for an underflow error? How would you decide if underflow has occured. Underflow is defined by number computed is less than minimum number representable. Documentation of strtod states the following:

If the correct value would cause underflow, the function returns a value whose magnitude is no greater than the smallest normalized positive number and sets errno to ERANGE.

We expect a number which is less than or equal to FLT_MIN or DBL_MIN. Let's check what exactly those macros are.

FLT_MIN : The value of this macro is the minimum normalized positive floating point number that is representable in type float. It is supposed to be no more than 1E-37. Source.

DBL_MIN : Same as FLT_MIN, for double.

In that case, you may ask what is minimum normalized value? Normalized numbers do not have leading zeros in decimal representation of a float. For instance,

Normalized : 1.17549e-038 (FLT_MIN)

Subnormal : 0.0017549e-41 (same number)

As you can see, even though FLT_MIN_EXP, exponent of minimum float is 38, we can write smaller numbers than it by allowing subnormal numbers. So, when you have a string represents a float smaller than FLT_MIN, it may be still representable and could smaller than FLT_MIN. Let's look at the code:

But wait, how? The number is smaller than FLT_MIN by all terms, exponent is smaller than FLT_MIN_10_EXP and it is still normal? Let's take a close look on the both numbers. My favorite tool for examine floats is IEEE-754 Analysis by Michael Lubow.

Let's check how FLT_MIN is represented in memory.

Decimal

HEX

Exponent (Binary)

Exponent (Decimal)

Significand (Decimal)

1.17549e-037

0x021FFFD9

00000100

-123

1.24999535084

1.17549e-038

0x007FFFE0

00000000

-126

0.99999618530

1.17549e-039

0x000CCCC9

00000000

-126

0.19999921322

1.17549e-040

0x000147AD

00000000

-126

0.01999986172

See the pattern? Exponent is in its minimum. We can't lower the number any further, that's why we hit FLT_MIN_10_EXP limit. (Why it is not -38? Because it is base2. 2-126=1.175494e-38.) However something else changes, the significand.

Well, that seem subnormal. Why isnormal() didn't return false then? Good question, and I don't have the answer. What I see from the tests, isnormal() doesn't return false until the number 1.17549430e-46.

A word about errno for underflow. Standard library is not obligated to raise ERANGE when underflow occurs. Do not count on it if you will support multiple compilers.

If you change your toolchains and save, then you will realize your makefile changes will make no effect and Eclipse will create a mysterious folder named Default, based on PWD environmental variable. This is due to a bug in Eclipse that enabled automatic makefile creation when you change toolchains.