开发者

C fprintf program outputing -1.#J instead of real numbers

开发者 https://www.devze.com 2023-01-01 20:55 出处:网络
Statement in program: fprintf(OutBasalArea,\"\\t %12.2lf\",SpecBasalArea[ks]); Getting -1.#J Why and what change开发者_运维百科 do I need to make to program statement?This happens because your numb

Statement in program:

fprintf(OutBasalArea,"\t %12.2lf",SpecBasalArea[ks]);

Getting -1.#J

Why and what change开发者_运维百科 do I need to make to program statement?


This happens because your number is -infinite.

Try to print the numbers without the length specifier 12.2 (use just %lf ). In this case, the output will be: -1.#INF00 (or something like that).

0

精彩评论

暂无评论...
验证码 换一张
取 消