Inconsistent rightmost numbers in track BPM field

Bug #1017369 reported by Sean M. Pappalardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
RJ Skerry-Ryan
1.11
Fix Released
Low
RJ Skerry-Ryan

Bug Description

v1.11 r3287
To reproduce: Right-click a track, go to the BPM field, type in 10.12345678, click Apply, then go back in and notice that it now shows "10.12345695". Trying also with "10.11111111" results in "10.11111069". Likewise "10.1" results in "10.10000038".

I'm not sure if this is just roundoff error or not. But even if so, then we probably shouldn't allow 8 decimal places if we can't reliably handle that many.

Tags: bpm manual

Related branches

Revision history for this message
Owen Williams (ywwg) wrote :

This is classic floating point value behavior. We should definitely be rounding the value in the widget to 2 or 3 places.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

This isn't a bug.. it's just how floating point numbers work.

Changed in mixxx:
status: New → Invalid
Revision history for this message
Max Linke (max-linke) wrote :

are these numbers stored with single or double precision in the db? With double precision there shouldn't be a rounding error

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Yea, the numbers are stored in 8-byte floating point. While messing with the bpm delegate have you noticed anything weird? It's true that 10.12345678 is representable as a double.

Changed in mixxx:
status: Invalid → Confirmed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Sorry Sean -- I was wrong. There were a couple places here and there where we were losing precision by casting the BPM to a single-precision float. Fixed in lp:mixxx/1.11 r3696 by always treating the BPM as a double. Confirmed that the value maintains its full precision across restarts so it's correct in the DB as well.

Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
status: Confirmed → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/6539

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.