#!/usr/bin/env node; /****************************************************************************** * This program computes quadratic equations. * * Copyright © 2016 Richard Lesh. All rights reserved. *****************************************************************************/ const Utils = require('./Utils'); const A = 3.; const B = 2.; const C = 1.; const main = async () => { let x = 0.; let y = A * x * x + B * x + C; console.log(Utils.format("f({0:.6g}) = {1:.6g}", x, y)); ++x; y = A * x * x + B * x + C; console.log(Utils.format("f({0:.6g}) = {1:.6g}", x, y)); ++x; y = A * x * x + B * x + C; console.log(Utils.format("f({0:.6g}) = {1:.6g}", x, y)); ++x; y = A * x * x + B * x + C; console.log(Utils.format("f({0:.6g}) = {1:.6g}", x, y)); } main().catch( e => { console.error(e) } );