[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] FP Library
From: |
Ron Kreymborg |
Subject: |
Re: [avr-gcc-list] FP Library |
Date: |
Mon Feb 5 10:14:04 2001 |
Further to my earlier request about the "undefined" dtostre and atof
functions, here is a small test program that can be easily cut and pasted
for testing.
#include <stdlib.h>
int main(void);
const char *number = "0.487467";
char result[20];
int main(void)
{
float theNumber;
// Convert ascii to floating point
theNumber = (float)atof(number);
// Convert back to a scientific format.
dtostre(theNumber, output, 4, 0x6);
// This should leave "+4.8747E-01" in result.
return 0;
}
My bare bones test compile and link lines were:
avr-gcc -c -mmcu=atmega103 test_dtostre.c -o test_dtostre.o
avr-gcc test_dtostre.o -lm -o test_dtostre.elf
I would appreciate any clues here if it is something I am doing wrong.
Ron