abs() - Is this limited to 16 bit????

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dan_DMI
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

 I am using the ADC in 20-bit mode (PSoC3), but the abs() works fine up to the 16-bit limit, then goes awry - so I have to use multiply by -1 instead, which works fine (although slightly more clumsy). Are there any work-arounds, and are there other 16-bit limited operations we should be aware of?

0 Likes
1 Reply
dan_DMI
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

 Have sorted! Now I know abs() is 16-bit, but fabs() & labs() are the "grown-up" versions. Sorry - I'm new to C!

0 Likes