[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with fmod()



Hi there.

I was having some problem with using fmod().
I tried then a simple program --

#include <stdio.h>
#include <math.h>

main()
{
  double d1 = fmod( 11.4, 3.1 );

  printf( "fmod(11.4, 3.1) is %d\n", (int)(d1) );
}

which I compiled with --

include $(APPS)/Rules.elinux
LIBDIR=$(AXISDIR)/products/tech/devboard/eroot/lib/
UCINCDIR=$(LIBDIR)/../include/uC-libc
CRT0=$(LIBDIR)/uccrt0.o
CFLAGS= -nostdinc -DUCLIBC -DM_SYSV -I$(UCINCDIR)
USE_UCLIBC=1

all : t.o
  $(CC) -v -nostdlib -s  $(CRT0) -o t t.o  -L$(LIBDIR) -lucc -lc -lgcc

p2.o : t.c
	$(CC) $(CFLAGS) -c t.c

When I run this, I get a fancy output --

sash#  ./p2
fmod(11.4, 3.1) is 1074161280

Is this some problem from my side or a bug in axis
floating point handling? One more small question -
why are all doubles/floats disabled in printf()?

I am using Axis 2400 camera server board with 1.0.2
release of software.

best wishes,
-- prabhat