3828 views|4 replies

3180

Posts

0

Resources
The OP
 

Problem with the abs function [Copy link]



My project has a warning about the abs function.

I have added the header file #include "math.h"

Can someone please tell me what's going on? Thanks!


This post is from stm32/stm8

Latest reply

Just include stdlib.h. abs is declared in stdlib.h. There is no need to include math.h. abs, labs are in stdlib.h; fabs is in math.h   Details Published on 2020-6-16 19:40
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 

14

Posts

0

Resources
2
 

Try #include <math.h>. I also suggest you understand the difference between "" and <>

This post is from stm32/stm8

Comments

No. Still the same  Details Published on 2020-6-16 18:30
 
 

3180

Posts

0

Resources
3
 
Comrade Xiao Wang posted on 2020-6-16 18:02 Try #include . I also suggest that you understand the difference between "" and <>

No. Still the same

This post is from stm32/stm8
 
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 

6040

Posts

204

Resources
4
 

Just include stdlib.h. abs is declared in stdlib.h. There is no need to include math.h.

abs, labs are in stdlib.h; fabs is in math.h

This post is from stm32/stm8

Comments

Thanks, all right.  Details Published on 2020-6-16 19:45
 
 
 

3180

Posts

0

Resources
5
 
lcofjp posted on 2020-6-16 19:40 Just include stdlib.h. abs is declared in stdlib.h. There is no need to include math.h. abs and labs are in stdlib.h; fabs is in math.h ...

Thanks, all right.

This post is from stm32/stm8
 
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list