D3.js fsum() Method Last Updated : 23 Sep, 2020 Comments Improve Suggest changes Like Article Like Report With the help of d3.fsum() method, we can get the full precision sum of a floating point array values by using this method and return sum of all the values. Syntax: d3.fsum([values]) Parameter: This function has the following parameter as mentioned above and described below: values: It is an array of values which is passed as parameter. Return Value: It return the full precision sum of values in an array. Note: To execute the below examples, you have to install the d3 library by using this command prompt we have to execute the following command. npm install d3 Example 1: In this example, we can see that by using d3.fsum() method, we are able to compute the full precision sum of floating point values in an array by using this method. Filename: index.js javascript // Defining d3 contrib variable var d3 = require('d3'); var gfg = d3.fsum([5.4, 4.5, 21.3, -1.9998372, 1.01]) console.log(gfg) Output: 30.210162800000003 Example 2: Filename: index.js javascript // Defining d3 variable var d3 = require('d3'); var arr = [] for(var i = 0; i < 5; i++) { arr.push(i); } var gfg = d3.fsum(arr) console.log(gfg) Output: 10 Note: The above program will compile and run by using the following command: node index.js Reference: https://github.com/d3/d3-array/blob/master/README.md Comment More infoAdvertise with us Next Article D3.js fsum() Method J Jitender_1998 Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js cumsum() Method With the help of d3.cumsum() method, we can get the cumulative sum of all the values of an array, that is the value at ith index is the cumulative sum of values from index 0 to index i by using this method. Syntax: d3.cumsum( iterable ) Parameter: This function has the following parameter as mention 2 min read D3.js Adder() Method With the help of d3.Adder() method, we can get the adder to compute the full precision sum of floating point values and set 0 as a default value by using this method. Syntax: const adder = new d3.Adder() Parameter: This function has no parameters. Return Value: It returns the adder to compute the fu 2 min read D3.js count() method With the help of d3.count() method, we can get the count of valid values in the specified iterable data structure. Syntax: d3.count(iterable[, accessor]) Return value: It returns the count of valid values. Note: To execute the below examples you have to install the d3 library by using the command pr 1 min read Node.js fs.fstat() Method The fs.fstat() method is used to return information about the given file descriptor. The fs.Stat object returned has several fields and methods to get more details about the file. Syntax: fs.fstat( fd, options, callback ) Parameters: This method accepts three parameters as mentioned above and descri 3 min read Node.js fs.stat() Method The fs.stat() method is used to return information about the given file or directory. It returns an fs.Stat object which has several properties and methods to get details about the file or directory. Syntax:fs.stat( path, options, callback )Parameters: This method accept three parameters as mentione 3 min read Like