C - Rounding issues (CS50)

前端 未结 2 861
旧巷少年郎
旧巷少年郎 2021-01-26 06:06

I have been Googling this for days now and I am lost. So doing CS50 online and can\'t seem to get a handle on this rounding of numbers. My program is messing up multiplying floa

2条回答
  •  鱼传尺愫
    2021-01-26 06:38

    I have seen the posts about -lm and a certain file but if I am honest I don't understand what it means.

    You have to link to the math library to fix the error. Math functions implementations are usually put as a separate library, the math library. If you use gcc add -lm to the linker command.

提交回复
热议问题