thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS
GNU General Public License v3.0
257 stars 91 forks source link

FIX: float16ToPayload #257

Closed mumpf closed 10 months ago

mumpf commented 10 months ago

Please merge this fix. Thanks. Waldemar

mumpf commented 10 months ago

Just a remark: I tested the fix also with negative numbers and also the reverse function float16FromPayload (in case there is this error, too). Everything works now fine!

mumpf commented 10 months ago

After additional tests there were still some rounding problems. Improved correction and did a test with full numeric range of DPT9. Finally, just value 0 results in a payload 0.