Skip to main content
added 7 characters in body
Source Link
chux
  • 36.5k
  • 2
  • 43
  • 97

Some side issues for OP.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain aan about 1-to-1 mapping of float to display value.

Some side issues for OP.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain a 1-to-1 mapping of float to display value.

Some side issues for OP.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain an about 1-to-1 mapping of float to display value.

added 28 characters in body
Source Link
chux
  • 36.5k
  • 2
  • 43
  • 97

Some side issues for OP.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain a 1-to-1 mapping of float to display value.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain a 1-to-1 mapping of float to display value.

Some side issues for OP.

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain a 1-to-1 mapping of float to display value.

Source Link
chux
  • 36.5k
  • 2
  • 43
  • 97

Deeper math issues

Best to use float constants rather than double ones to initialize a float array.

float X[row * column] = { -0.251521, 1.045117, -1.281658,
// float X[row * column] = { -0.251521f, 1.045117f, -1.281658f,

Sometimes it makes a value difference and it quiets certain warnings.


There are multiple float that when printed to 6 places report 0.178434.

In general, use at least FLT_DECIMAL_DIG (9) significant digits to maintain a 1-to-1 mapping of float to display value.