lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


hi list,

this is a new implement of Luiz's lmapm module:

https://github.com/starwing/lmapm

 I exported all functions from mapm, and add some new features:

- add ifunc functions (functions prefix i) to modified version of
function, e.g. a = mapm(10); a:iadd(20), and then a turns to 30.
- add new controls to tostring, now output precision and calculate
precision can not be the same.
- renamed some functions:
   - number to new
   - version to _VERSION
   - add _COPYRIGHT
   - compare to cmp
   - digits to setprec
   - digitsin to digits
- setprec (previous digits) are extended, now you can specified two
precision: the calculate one and the tostring one. the format is:
   mapm.setprec(prec[, tostring_prec]) --> old_prec
     - if tostring_prec is omitted, the prec will be used (just as the
old behavior)
     - if tostring_prec is given as a number, that value will be used.
     - if tostring_prec is true value (any other value except number,
nil and false), the -1 will used, means output all digits
- tostring is extended, now if number is a integer and tostring_prec
is -1, the trimmed .0 will not output.
- pow will use pow, integer_pow, integer_pow_nr, depends argument given.
- use static work temporary variables to store intermediate result.
- some more little changes.

the original test can run correctly. any feedbacks welcome :-)