Editing ESM Math Library

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 574: Line 574:
set myResultAngle to f.fout</pre>
set myResultAngle to f.fout</pre>


=== Stage 40: Natural Logarithm ===
=== Stage 40: NaturalLogarithm ===
Takes an antilogarithm a (float) and returns the exponent b (float) to the base e(=2.71828...):<br>
Takes an antilogarithm a (float) and returns the exponent b (float) to the base e(=2.71828...):<br>
a=e^b --> b=LN(a)<br>
a=e^b --> b=LN(a)<br>
Line 602: Line 602:
  set f.fout to 0
  set f.fout to 0
  set f.LN_n to 0
  set f.LN_n to 0
elseif f.fin1 > 4 || f.fin1 < 0.25
elseif f.fin1 > 4 || f.fin1 < 0.25 ;change values for better or worse accuracy (makes the script faster)
;change values for better (slower processing) or worse accuracy (faster processing)
;this configuration should provide an accuracy of at least 99.99%
  ;LN(x) = n * LN( nthRoot(x) )
  ;LN(x) = n * LN( nthRoot(x) )
  set f.LN_n to (f.LN_n * 2)
  set f.LN_n to (f.LN_n * 2)
Line 671: Line 669:
set f.t11 to (f.t10*f.t1)
set f.t11 to (f.t10*f.t1)


set f.fout to (1 + f.t1 + f.t2/2 + f.t3/6 + f.t4/24 + f.t5/120 + f.t6/720 + f.t7/5040 + f.t8/40320 + f.t9/362880 + f.t10/3628800 + f.t11/39916800) ;attend to write this in one line</pre>
set f.fout to (1 + f.t1 + f.t2/2 + f.t3/6 + f.t4/24 + f.t5/120 + f.t6/720 + f.t7/5040 + f.t8/40320 + f.t9/362880 + f.t10/3628800 + f.t11/39916800)</pre>
Actually, more terms won't increase accuracy any more, because Oblivion can't handle higher values.
Actually, more terms won't increase accuracy any more, because Oblivion can't handle higher values.


Please note that all contributions to the Oblivion ConstructionSet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see CSwiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)