time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (2384B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # Natural Exponential Function
     22 
     23 > Natural [exponential function][exponential-function].
     24 
     25 <section class="intro">
     26 
     27 The natural [exponential function][exponential-function] is defined as
     28 
     29 <!-- <equation class="equation" label="eq:natural_exponential_function" align="center" raw="y = e^x" alt="Natural exponential function definition"> -->
     30 
     31 <div class="equation" align="center" data-raw-text="y = e^x" data-equation="eq:natural_exponential_function">
     32     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/exp/docs/img/equation_natural_exponential_function.svg" alt="Natural exponential function definition">
     33     <br>
     34 </div>
     35 
     36 <!-- </equation> -->
     37 
     38 where `e` is [Euler's][@stdlib/constants/float64/e] number.
     39 
     40 </section>
     41 
     42 <!-- /.intro -->
     43 
     44 <section class="usage">
     45 
     46 ## Usage
     47 
     48 ```javascript
     49 var exp = require( '@stdlib/math/base/special/exp' );
     50 ```
     51 
     52 #### exp( x )
     53 
     54 Evaluates the natural [exponential function][exponential-function].
     55 
     56 ```javascript
     57 var v = exp( 4.0 );
     58 // returns ~54.5982
     59 
     60 v = exp( -9.0 );
     61 // returns ~1.234e-4
     62 
     63 v = exp( 0.0 );
     64 // returns 1.0
     65 
     66 v = exp( NaN );
     67 // returns NaN
     68 ```
     69 
     70 </section>
     71 
     72 <!-- /.usage -->
     73 
     74 <section class="examples">
     75 
     76 ## Examples
     77 
     78 <!-- eslint no-undef: "error" -->
     79 
     80 ```javascript
     81 var randu = require( '@stdlib/random/base/randu' );
     82 var exp = require( '@stdlib/math/base/special/exp' );
     83 
     84 var x;
     85 var i;
     86 
     87 for ( i = 0; i < 100; i++ ) {
     88     x = (randu()*100.0) - 50.0;
     89     console.log( 'e^%d = %d', x, exp( x ) );
     90 }
     91 ```
     92 
     93 </section>
     94 
     95 <!-- /.examples -->
     96 
     97 <section class="links">
     98 
     99 [exponential-function]: https://en.wikipedia.org/wiki/Exponential_function
    100 
    101 [@stdlib/constants/float64/e]: https://www.npmjs.com/package/@stdlib/constants-float64-e
    102 
    103 </section>
    104 
    105 <!-- /.links -->