problem with long double and double - Programmers Heaven

Howdy, Stranger!

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

Categories

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.