An update to smart-serial will allow parameters to be set from HAL,
rather than using the (clunky) setsserial method.

But, you don't want to be updating parameters that haven't changed.
(that could potentially wear out the eeprom).

So, I need to check if the value read back from the remote card at
startup is equal to the value typed in the HAL file (unknown
precision, but stored in a double in HAL).

I have read 
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

And that does describe what seems like one sensible approach, subtract
the integer representations of the numbers.

I have been thinking about making the HAL pin fields in sserial.h
occupy a union (it just seems like the right thing to do) and that
would facilitate this.

But there is a wrinkle. The values read back from the remote card can,
potentially, be any length, though I only propose to support binary-8,
binary-16, binary-32 and binary-64. (and binary 128 won't fit in the
registers).

I do know how many bits were in the original data at the point of the
comparison operation.

Any ideas? I am thinking that, in theory, I can do the subtraction and
check that the answer is < 2^(double_mantissa bits -
data_format_mantissa_bits) ?

Any thoughts?

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to