Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

problem with long double and double

myth.12887myth.12887 Posts: 33Member
im using the gcc compiler for windows..
when i use double, up to a point the prgrm works fine but after i multiply two very large matrices, i got values as -1.#INF and 1.#IND...i supposed they were due to double no tbeing abel to hold the values.but when i used long double, all the values n all the arrays cahnage to either 2, -2 or zero.....i dnt know why this is happening...i backed up the program a little bit and then saw tha a simple statement like a[0]=1 gives a[0] as 0.000000 whn i print it on the screen.

Comments

  • JonathanJonathan Posts: 2,914Member
    : im using the gcc compiler for windows..
    : when i use double, up to a point the prgrm works fine but after i
    : multiply two very large matrices, i got values as -1.#INF and
    : 1.#IND...i supposed they were due to double no tbeing abel to hold
    : the values.but when i used long double, all the values n all the
    : arrays cahnage to either 2, -2 or zero.....i dnt know why this is
    : happening...i backed up the program a little bit and then saw tha a
    : simple statement like a[0]=1 gives a[0] as 0.000000 whn i print it
    : on the screen.
    :
    How are you printing the number? If you're using %f in printf, I think if you change the type of the value to long double you need to use (please check this) %Lf instead.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
Sign In or Register to comment.