Skip to content
Advertisement

How to Yeld Floats in a For Loop

I’m trying to fit a curve to some data. When I evaluate the polynomial equation with one value, I get an expected float answer. When I evaluate the polynomial equation over an array, the for loop yields integer values when the intended result is floats.

I think I’m close, but I’m not sure what I’m doing wrong. Please advise.

JavaScript

Advertisement

Answer

Just issues with your b_new change like this,

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement