- Posts: 629
- Thank you received: 0
"-0" degrees on the telemetry?
- pipedream
- [pipedream]
- Topic Author
- Offline
- Premium Member
Less
More
03 Jan 2017 12:36 #228098
by pipedream
"-0" degrees on the telemetry? was created by pipedream
While making my routine morning check of the NWAC telemetry, I noticed that the temperature at the telemetry site at the top of Tye Mill @ Stevens Pass had reported both a "0" and "-0" temperature reading. It since has flipped back and forth until finally warming above 0F at 0900 PST. Anybody have a good explanation for how this can be? I'm guessing a rounding issue, but is it possible the telemetry isn't using
two's complement
like it should be?
Please Log in or Create an account to join the conversation.
- mfonda
- [mfonda]
- Offline
- New Member
Less
More
- Posts: 27
- Thank you received: 0
03 Jan 2017 13:14 #228101
by mfonda
Replied by mfonda on topic Re: "-0" degrees on the telemetry?
I know nothing about how these systems actually work, but my guess would be the raw data is stored as floats, then rounded when displayed. This would then indicate that it's very near but slightly below zero. For example, it might look something like the following:
mfonda@dev-mfonda:~$ cat example.c
#include <stdio.h>
int main() {
float n = -1 / 1e10;
printf("%.0f", n);
return 0;
}
mfonda@dev-mfonda:~$ gcc example.c && ./a.out
-0
Please Log in or Create an account to join the conversation.
- runningclouds
- [runningclouds]
- Offline
- Junior Member
Less
More
- Posts: 141
- Thank you received: 0
03 Jan 2017 14:06 - 03 Jan 2017 14:09 #228102
by runningclouds
Replied by runningclouds on topic Re: "-0" degrees on the telemetry?
Please Log in or Create an account to join the conversation.
- pipedream
- [pipedream]
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 629
- Thank you received: 0
03 Jan 2017 16:14 #228104
by pipedream
Replied by pipedream on topic Re: "-0" degrees on the telemetry?
I feel like I've asked this question before, but I can't find anything about it in my post history.
I do believe the issue is with rounding the float but retaining the '-' sign, like the example in mfonda's reply. Either way, it's entertaining to a programmer like me ;D
I do believe the issue is with rounding the float but retaining the '-' sign, like the example in mfonda's reply. Either way, it's entertaining to a programmer like me ;D
Please Log in or Create an account to join the conversation.