Skip to content

Lua 5.3 compatibility #11

Description

@apdougla

For compatibility with lua 5.3.5, please consider making the following changes:

diff -rw lua-matrix-master lua-matrix-master-5.3.5

diff -rw lua-matrix-master/lua/matrix.lua lua-matrix-master-5.3.5/lua/matrix.lua

1042c1042

< mtx[i][j] = tonumber( loadstring( "return "..m1[i][j][1] )() )

---

> mtx[i][j] = tonumber( load( "return "..m1[i][j][1] )() )

diff -rw lua-matrix-master/samples/fit.lua lua-matrix-master-5.3.5/samples/fit.lua

33c33

< return unpack( tres )

---

> return table.unpack( tres )

diff -rw lua-matrix-master/test/test_complex.lua lua-matrix-master-5.3.5/test/test_complex.lua

17,18c17,18

< assert( tostring( complex '-10.2e2' ) == '-1020' )

< assert( tostring( complex '-10.2E+02' ) == '-1020' )

---

> assert( complex.tostring( complex('-10.2e2'), '%.0f' ) == '-1020' )

> assert( complex.tostring( complex('-10.2E+02'), '%.0f' ) == '-1020' )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions