Page MenuHome

Matrix lost many float's precision in last column only?
Closed, InvalidPublic

Description

System Information
win10
Nvidia Geforce GTX 760

Blender Version
Broken: (2.79.1, 2.80.1)
Worked: (unkown)

Short description of error
Matrix lost many float's precision in last column only?

Exact steps for others to reproduce the error

>>> x = [(-0.9241514048962116, 0.2337729712426016, -0.3021495966318076, -1929571.5224466173),
             (-0.3820264137835999, -0.5655148754268845, 0.7309232140536767, 4667782.564183826),
             (0, 0.7909128419663705, 0.6119288164588091, 3881706.1884651887),
             (0, 0, 0, 1)]


>>> x = Matrix(x)

>>> x
Matrix(((-0.9241514205932617, 0.23377297818660736, -0.30214959383010864, -1929571.5),
        (-0.38202640414237976, -0.565514862537384, 0.7309232354164124, 4667782.5),
        (0.0, 0.7909128665924072, 0.6119288206100464, 3881706.25),
        (0.0, 0.0, 0.0, 1.0)))

The result lost precision in last column only:

-1929571.5224466173 >>>> -1929571.5
4667782.564183826    >>>> 4667782.5
3881706.1884651887   >>>> 3881706.25

I dont konw Is that normal?
Thanks for your Great work!

Details

Type
Bug

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Confirmed, High.
Bastien Montagne (mont29) edited projects, added Python; removed BF Blender: 2.8.

Wooo… ugly! :/

This is normal. Single precision floats only have 6-7 digits of precision, so for large numbers like in the last column there will be loss of precision. Python uses double precision but for Blender itself this would have a significant performance / memory impact.

@Bastien Montagne (mont29), didn't see your reply before I commented, if you think there's a bug here will let you handle it.

pfff… no actually, you nailed to point @Brecht Van Lommel (brecht)! I probably need to wake up a bit more here :(