Skip to content

Commit 8e7101a

Browse files
committed
docs: update README and examples
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2177682 commit 8e7101a

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

lib/node_modules/@stdlib/array/float16/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ var Float16Array = require( '@stdlib/array/float16' );
15351535
var out = new Float16Array( 3 );
15361536
logEach( '%s', out );
15371537

1538-
// Create a boolean array from an array of numbers:
1538+
// Create a half-precision floating-point number array from an array of numbers:
15391539
var arr = [ 1.05, 2.05, 3.05 ];
15401540
out = new Float16Array( arr );
15411541
logEach( '%s', out );

lib/node_modules/@stdlib/array/float16/examples/index.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
22-
var ctor = require( './../lib' );
21+
var Uint16Array = require( '@stdlib/array/uint16' );
22+
var logEach = require( '@stdlib/console/log-each' );
23+
var Float16Array = require( './../lib' );
2324

24-
var arr;
25-
var i;
25+
// Create a half-precision floating-point number array by specifying a length:
26+
var out = new Float16Array( 3 );
27+
logEach( '%s', out );
2628

27-
arr = new ctor( 10 );
28-
for ( i = 0; i < arr.length; i++ ) {
29-
arr[ i ] = randu() * 100.0;
30-
}
31-
console.log( arr );
29+
// Create a half-precision floating-point number array from an array of numbers:
30+
var arr = [ 1.05, 2.05, 3.05 ];
31+
out = new Float16Array( arr );
32+
logEach( '%s', out );
33+
34+
// Create a half-precision floating-point number array from an array buffer:
35+
arr = new Uint16Array( [ 1000, 2000, 3000, 4000 ] );
36+
out = new Float16Array( arr.buffer );
37+
logEach( '%s', out );
38+
39+
// Create a half-precision floating-point number array from an array buffer view:
40+
arr = new Uint16Array( [ 1000, 2000, 3000, 4000 ] );
41+
out = new Float16Array( arr.buffer, 2, 2 );
42+
logEach( '%s', out );

0 commit comments

Comments
 (0)