J
J
JhaoDa2012-05-22 23:52:43
Programming
JhaoDa, 2012-05-22 23:52:43

Is it half-precision floating-point?

There is a temperature controller TERMODAT-19E4. According to the documentation, it returns the sensor readings in the form of two bytes, for example, " FD93h " (or maybe it should be read as " 93FDh ", the order is not specified, anything has happened), which in translation into human is -62.1 ° C (example from documentation). Are they half-precision numbers, referred to as binary16
in IEEE 754 ? Maybe someone has met with something similar and can suggest a conversion algorithm?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
megalol, 2012-05-23
@JhaoDa

FD93 is a two's complement number, meaning -621 in decimal.
Conversion algorithm:
#include int main()
{
short x = 0xFD93;
std::cout << float(x)/10;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question