Yeah, you could express it like that
- 0 Posts
- 7 Comments
It’s a C++17 feature that allows specifying a power of two (as decimal exponent) by which the fractional part should be multiplied.
From the documentation (emphasis mine):
If the floating literal begins with the character sequence
0xor0X, the floating literal is a hexadecimal floating literal. Otherwise, it is a decimal floating literal.For a hexadecimal floating literal, the significand is interpreted as a hexadecimal rational number, and the digit-sequence of the exponent is interpreted as the (decimal) integer power of 2 by which the significand has to be scaled.
double d = 0x1.4p3; // hex fraction 1.4 (decimal 1.25) scaled by 2^3, that is 10.0You can find the full documentation here: cppreference.com
So in your example
0x1P1means 116 * 2^(110) = 2
blackjacksepp@feddit.deto
Selfhosted@lemmy.world•How to monitor standard nginx accesses?English
1·3 years agoHave a look at nginx vts. I run it on my Raspberry Pi, it works great and provides everything I need! The auto-installer is easy to use and it can output as html, json or prometheus.
blackjacksepp@feddit.deto
Selfhosted@lemmy.world•Best services to self host with a Raspberry Pi 4? (4GB RAM)English
2·3 years agoTrue. Do you happen to know any lightweight alternatives? I’ve been wanting to check out VictoriaMetrics for a while but haven’t found the time…
blackjacksepp@feddit.deto
Selfhosted@lemmy.world•Best services to self host with a Raspberry Pi 4? (4GB RAM)English
15·3 years agoI am currently running
- Nextcloud: slow, but great for Calendar or Notes
- Gonic
- Airsonic Refix
- transfer.sh
- FileBrowser
- Conduit
- Cinny
- Mosquitto
- Prometheus
- Grafana
The last three are quite niche. I use Prometheus + Grafana for Monitoring the Pi itself and for displaying MQTT Stats. Since upgrading to SSDs performance is actually quite good, especially when taking power usage into account.
There is decimal scientific notation for specifying a decimal exponent already (
123e4 = 123×10^4).And I don’t know why the committee preferred base 2 over base 16, I think it really depends on the use case which one is more useful.