Changes

Jump to navigation Jump to search

math.eval

1 byte added, 21:01, 19 April 2016
m
no edit summary
Line 13: Line 13:  
'''Example''' : To evaluate ''f1'' for a given value in x, the parameter x must be converted to a string, and then any embedded "e" must be replaced with Unicode character U+F000. <br />
 
'''Example''' : To evaluate ''f1'' for a given value in x, the parameter x must be converted to a string, and then any embedded "e" must be replaced with Unicode character U+F000. <br />
   −
<source lang="lua">local mx = tostring(x):gsub("e", string.uhar(0xF000))
+
<source lang="lua">local mx = tostring(x):gsub("e", string.uchar(0xF000))
 
local expr = "f1(" .. mx .. ")"
 
local expr = "f1(" .. mx .. ")"
 
return math.eval(expr)</source>  
 
return math.eval(expr)</source>  

Navigation menu