arduino / arduino/reference-en

abs() does not work on floats

Open
#362 11 comments 13 reactions 1 assignee Claimed by @cmaglie View on GitHub
Dominant language
No language data
Stars
173
Forks
704
PR merge metrics
No merged PRs in 30d

Description

I'm not sure how to rewrite the page, so I rather write it here as issue instead of pull-request.

abs() does not work on floats, because it returns an int. It does not say so in the documentation at https://github.com/arduino/reference-en/blob/master/Language/Functions/Math/abs.adoc

Apparently for floats there exists [fabs](https://www.mkssoftware.com/docs/man3/fabs.3.asp)(), but this is not written in the arduino ref docs.

Should this be added, or is there some reason for this information missing?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.