- Posts: 629
- Thank you received: 0
"-0" degrees on the telemetry?
- pipedream
-
Topic Author
- User
-
Less
More
9 years 1 month ago #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
-
- User
-
Less
More
- Posts: 27
- Thank you received: 0
9 years 1 month ago #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:
Code:
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
-
- User
-
Less
More
- Posts: 141
- Thank you received: 0
9 years 1 month ago - 9 years 1 month ago #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
-
Topic Author
- User
-
Less
More
- Posts: 629
- Thank you received: 0
9 years 1 month ago #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
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
Please Log in or Create an account to join the conversation.