The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fprintf output: What does -0 mean?
Replies: 6   Last Post: Jan 27, 2014 11:17 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2,359
Registered: 12/6/04
Re: fprintf output: What does -0 mean?
Posted: Jan 24, 2014 11:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply wrote in message <>...
> I get a negative zero when printing a set of coefficients of lasso regression:

> >> format longg
> >> fprintf('%e\n',B(:,86))

> 0.000000e+00
> -0.000000e+00
> -0.000000e+00
> -1.367172e-01
> 0.000000e+00
> -6.460915e-02
> -1.078923e-10
> I can't provide simple code to do duplicate. A simply cut/paste of the above text to assign into a variable x does not yield the same fprintf results.
> What would cause the negative zero? How should it be interpretted?

It's probably just a VERY small negative number that you don't have enough significant digits to see.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.