Skip to content

Commit e9f59cc

Browse files
committed
docs: update dev faqs
--- 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 83102e3 commit e9f59cc

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

docs/dev_faqs.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ limitations under the License.
3333
- [I am facing a `Shadowed declaration` linting error in my C files, how can I fix it?](#shadowed-declaration)
3434
- [I am facing a `Uninitialized variable` linting error in my C files, how can I fix it?](#uninitialized-variable)
3535
- [I have the required packages in the expected paths, but I am still encountering an error like this while compiling the native add-on.](#compilation-error)
36+
- [When should I use decimals in examples, benchmarks, and documentation, and when should I avoid them?](#decimal-usage)
3637
- [How should I name my pull request?](#pr-naming)
3738
- [How do I call the stdlib bot on my PR?](#stdlib-bot)
3839
- [Frequently used `make` commands](#freq-make-commands)
@@ -160,33 +161,6 @@ You can suppress that warning by adding a `// cppcheck-suppress uninitvar` comme
160161
stdlib_strided_dmeanvarpn( len, 1, x, 1, out, 1 );
161162
```
162163
163-
<a name="decimals">
164-
165-
## When to use decimals while writing examples, benchmarks and documentation and when should I avoid it?
166-
167-
Decimals are our way of showing that the number that we're trying to denote is a floating point value in C. Note that all numbers in JavaScript are treated as a floating point value. for example:
168-
169-
while trying to call this function
170-
171-
```c
172-
double stdlib_strided_dnanvariancetk( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX );
173-
```
174-
175-
in javascript or in C, we expect you to write
176-
177-
```javascript
178-
var dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' );
179-
var Float64Array = require( '@stdlib/array/float64' );
180-
181-
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
182-
183-
var v = dnanvariancetk( 4, 1.0, x, 1 );
184-
// returns ~4.33333
185-
```
186-
187-
<!--- TODO - complete this and proof read--->
188-
notice how we used `1.0` in the second arguement because it is a double precision floating point number, while we didn't use it in the first and fourth arguements as they are integers
189-
190164
<a name="compilation-error"></a>
191165
192166
## I have the required packages in the expected paths, but I am still encountering an error like this while compiling the native add-on.
@@ -252,6 +226,30 @@ In packages involving C implementations, you need a `manifest.json` file to info
252226

253227
This `config` specifies that we need to include `@stdlib/math/base/napi/unary`, `@stdlib/math/base/assert/is-nanf`, and `@stdlib/constants/float32/pinf` for compiling the native add-on, while `@stdlib/math/base/assert/is-nanf` and `@stdlib/constants/float32/pinf` are required for running benchmarks and examples.
254228

229+
<a name="decimal-usage"></a>
230+
231+
## When should I use decimals in examples, benchmarks, and documentation, and when should I avoid them?
232+
233+
Decimals help us differentiate floating-point values from integers. For instance, in JavaScript, all numbers are treated as floating-point values, but it is still important to distinguish between integers and floating-point numbers for clarity. Consider the following C function:
234+
235+
```c
236+
double stdlib_strided_dnanvariancetk( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX );
237+
```
238+
239+
When calling this function in JavaScript, we expect the following usage:
240+
241+
```javascript
242+
var dnanvariancetk = require( '@stdlib/stats/base/dnanvariancetk' );
243+
var Float64Array = require( '@stdlib/array/float64' );
244+
245+
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
246+
247+
// Use decimals for floating-point values, not for integers.
248+
var v = dnanvariancetk( 4, 1.0, x, 1 );
249+
```
250+
251+
Notice that we used `1.0` as the second argument because it is a double-precision floating-point number. However, we did not use a decimal point for the first and fourth arguments, as they represent integers.
252+
255253
<a name="pr-naming"></a>
256254

257255
## How should I name my pull request?

0 commit comments

Comments
 (0)