Hexadecimal Floating Pont Literal

I was more than pleasantly surprised to see that Chapel supports this rigorously as in either

const x = 0x1.2;
const y = 0x1.0p-1022;

assert(x = 0x1.2p0);

Unlike C, it allows the scaling (by a power of 2) to be optional.

As an aside, remember that the exponent of a hexadecimal floating point constant is a decimal number.

Excellent work team.

3 Likes