![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
I keep needing things like abs().
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |
| |
| | #2 | |
| Quote:
Code: int abs(int n) {
return n > 0 ? n : -n;
}
[Edit: You can browse the libc code here: http://sourceware.org/cgi-bin/cvsweb...?cvsroot=glibc ] Last edited by Torben; 31st March 2008 at 05:26 AM. | ||
| |
| | #3 | ||
| Quote:
It's been many many years since I built my own libs for C. I'll have to refresh my foggy old memory. Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 31st March 2008 at 08:33 AM. | |||
| |
| | #4 | |
| Quote:
I should have known it would be that simple. My Bresenham line routine now works perfect. Building some nice demos for the site.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
|
| Tags |
| boostc, lib, mathh |
| Thread Tools | |
| Display Modes | |
| |