diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/pi.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/pi.js b/js/pi.js new file mode 100644 index 0000000..b15e62f --- /dev/null +++ b/js/pi.js @@ -0,0 +1,14 @@ +// read in pi, ../10000.pi.txt + +const fs = require('fs'); + +fs.readFile('../10000.pi.txt', 'utf8', (err, data) => { + if (err) { + console.error(err); + return; + } + const string_pi = data; + const big_pi = parseFloat(data); + console.log(big_pi); +}); + |