Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Bug - floating point rounding?

Pages: [1]
Author Topic: Bug - floating point rounding?
rgwynnjones
Member
Posts: 26
Post Bug - floating point rounding?
on: January 5, 2022 (GMT)

Hi,
Sorry to create new topic, but did not see a topic for (potential) bugs.

Tablet Torque version 1.10.238

“0GEN1 Version date”, “Build date”,”22F8F3″,”(C

piemmm
Administrator
Posts: 6623
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Hi!

> and < will not be parsed by the website you will need to convert them to their entity names

rgwynnjones
Member
Posts: 26
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Can bus example;

154.3 Rx 07E3 8 03 22 F8 F3 00 00 00 00
154.6 Rx 07EB 8 10 09 62 F8 F3 00 6D 05
154.9 Rx 07E3 8 30 00 00 00 00 00 00 00
155.1 Rx 07EB 8 21 39 7F B1 00 00 00 00

Value is 0x05397FB1 decimal 87654321 You can see those values in C D E F positions in the can log

Gauge shows “87654320” – notice the last digit should be 1.

Only seems to happen with odd last values. Appears to be a rounding error converting this largish uint32 value to float.

I can change the Pid definition formula of there is another way that keeps the data as uint32 and avoids the floating point conversion – if that indeed is the issue.

piemmm
Administrator
Posts: 6623
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Hi!

probably easier to email it to me at ian@prowl.org :) – possibly float rounding would need to see – if I can see then equation I can likely improve it here too

rgwynnjones
Member
Posts: 26
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Here is the Pid def, with the entity name for less-than (bitwise shift left) sign replaced;

“0GEN1 Version date”, “Build date”,”22F8F3″,”(C < 24)+(D < 16)+(E < 8)+F”,0,20991231,”YYYYMMDD”,”7E3″

piemmm
Administrator
Posts: 6623
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Hi!

(Getting late here so this is a quick post I havent checked)

The function:
INT32(C:D:E:F)

might be what you want, though both should work so I’ll set up a test rig tomorrow and see what’s up

rgwynnjones
Member
Posts: 26
Post Re: Bug - floating point rounding?
on: January 5, 2022 (GMT)

Ah I thought that INT32 would fix it but sadly no.
When testing the Pid it shows;

Result for equation: 8.765432E7

So the float is still happening.

“Equation Steps” shows the right value;
=INT32(C:D:E:F)
=87654321

Real time display gauge still shows 87654320

piemmm
Administrator
Posts: 6623
Post Re: Bug - floating point rounding?
on: January 7, 2022 (GMT)

Hi!

Reproduced here so I will look at seeing what I can do with this in the next feature release (starting next week)

rgwynnjones
Member
Posts: 26
Post Re: Bug - floating point rounding?
on: January 7, 2022 (GMT)

Wonderful – thanks for the update.
Fairly low priority for me.
As a bug bounty :-) can you please take a moment to look at my “decimal places” “display default” question in its own thread?
See if this link works;
https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=16447.0

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.029 seconds.

  Follow me on twitter