diff options
author | jofret | 2008-04-21 14:12:52 +0000 |
---|---|---|
committer | jofret | 2008-04-21 14:12:52 +0000 |
commit | 002e79572a8533656d7171e52cabe08d10110c72 (patch) | |
tree | 1715e1bb3729f5ac921abe50902e7035eb74ef3f | |
parent | 3ec0796bd59457048a865f3640f3e310663fc407 (diff) | |
download | scilab2c-002e79572a8533656d7171e52cabe08d10110c72.tar.gz scilab2c-002e79572a8533656d7171e52cabe08d10110c72.tar.bz2 scilab2c-002e79572a8533656d7171e52cabe08d10110c72.zip |
Double vs Float better management. Enable psycho warnings.
-rw-r--r-- | src/elementaryFunctions/log/Makefile.am | 30 | ||||
-rw-r--r-- | src/elementaryFunctions/log/Makefile.in | 196 | ||||
-rw-r--r-- | src/elementaryFunctions/log/clogs.c | 22 | ||||
-rw-r--r-- | src/elementaryFunctions/log/dloga.c | 22 | ||||
-rw-r--r-- | src/elementaryFunctions/log/slogs.c | 22 | ||||
-rw-r--r-- | src/elementaryFunctions/log/testDoubleLog.c | 36 | ||||
-rw-r--r-- | src/elementaryFunctions/log/testFloatLog.c | 36 | ||||
-rw-r--r-- | src/elementaryFunctions/log/testLog.h | 38 | ||||
-rw-r--r-- | src/elementaryFunctions/log/zlogs.c | 22 |
9 files changed, 357 insertions, 67 deletions
diff --git a/src/elementaryFunctions/log/Makefile.am b/src/elementaryFunctions/log/Makefile.am index d6fb3e75..bf352aca 100644 --- a/src/elementaryFunctions/log/Makefile.am +++ b/src/elementaryFunctions/log/Makefile.am @@ -10,8 +10,8 @@ ## ## -libLog_la_CFLAGS = -I ../../type \ - -I ../includes +libLog_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes instdir = $(top_builddir)/lib @@ -28,4 +28,28 @@ SRC = slogs.c \ cloga.c \ zloga.c -HEAD = ../includes/log.h +HEAD = $(top_builddir)/elementaryFunctions/includes/log.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + @LIBMATH@ + +check_PROGRAMS = testFloatLog testDoubleLog + +TESTS = testFloatLog testDoubleLog + +testFloatLog_SOURCES = testFloatLog.c +testFloatLog_CFLAGS = $(check_INCLUDES) +testFloatLog_LDADD = $(check_LDADD) + +testDoubleLog_SOURCES = testDoubleLog.c +testDoubleLog_CFLAGS = $(check_INCLUDES) +testDoubleLog_LDADD = $(check_LDADD) diff --git a/src/elementaryFunctions/log/Makefile.in b/src/elementaryFunctions/log/Makefile.in index 511999a7..40bc31b9 100644 --- a/src/elementaryFunctions/log/Makefile.in +++ b/src/elementaryFunctions/log/Makefile.in @@ -32,6 +32,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testFloatLog$(EXEEXT) testDoubleLog$(EXEEXT) +TESTS = testFloatLog$(EXEEXT) testDoubleLog$(EXEEXT) subdir = elementaryFunctions/log DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -60,6 +62,21 @@ libLog_la_OBJECTS = $(am_libLog_la_OBJECTS) libLog_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libLog_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testDoubleLog_OBJECTS = testDoubleLog-testDoubleLog.$(OBJEXT) +testDoubleLog_OBJECTS = $(am_testDoubleLog_OBJECTS) +am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la +testDoubleLog_DEPENDENCIES = $(am__DEPENDENCIES_1) +testDoubleLog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleLog_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testFloatLog_OBJECTS = testFloatLog-testFloatLog.$(OBJEXT) +testFloatLog_OBJECTS = $(am_testFloatLog_OBJECTS) +testFloatLog_DEPENDENCIES = $(am__DEPENDENCIES_1) +testFloatLog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatLog_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. -I$(top_builddir)/includes@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +89,10 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libLog_la_SOURCES) -DIST_SOURCES = $(libLog_la_SOURCES) +SOURCES = $(libLog_la_SOURCES) $(testDoubleLog_SOURCES) \ + $(testFloatLog_SOURCES) +DIST_SOURCES = $(libLog_la_SOURCES) $(testDoubleLog_SOURCES) \ + $(testFloatLog_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -185,8 +204,8 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -libLog_la_CFLAGS = -I ../../type \ - -I ../includes +libLog_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes instdir = $(top_builddir)/lib pkglib_LTLIBRARIES = libLog.la @@ -200,7 +219,25 @@ SRC = slogs.c \ cloga.c \ zloga.c -HEAD = ../includes/log.h +HEAD = $(top_builddir)/elementaryFunctions/includes/log.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + @LIBMATH@ + +testFloatLog_SOURCES = testFloatLog.c +testFloatLog_CFLAGS = $(check_INCLUDES) +testFloatLog_LDADD = $(check_LDADD) +testDoubleLog_SOURCES = testDoubleLog.c +testDoubleLog_CFLAGS = $(check_INCLUDES) +testDoubleLog_LDADD = $(check_LDADD) all: all-am .SUFFIXES: @@ -264,6 +301,19 @@ clean-pkglibLTLIBRARIES: libLog.la: $(libLog_la_OBJECTS) $(libLog_la_DEPENDENCIES) $(libLog_la_LINK) -rpath $(pkglibdir) $(libLog_la_OBJECTS) $(libLog_la_LIBADD) $(LIBS) +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +testDoubleLog$(EXEEXT): $(testDoubleLog_OBJECTS) $(testDoubleLog_DEPENDENCIES) + @rm -f testDoubleLog$(EXEEXT) + $(testDoubleLog_LINK) $(testDoubleLog_OBJECTS) $(testDoubleLog_LDADD) $(LIBS) +testFloatLog$(EXEEXT): $(testFloatLog_OBJECTS) $(testFloatLog_DEPENDENCIES) + @rm -f testFloatLog$(EXEEXT) + $(testFloatLog_LINK) $(testFloatLog_OBJECTS) $(testFloatLog_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -278,6 +328,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLog_la-slogs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLog_la-zloga.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLog_la-zlogs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleLog-testDoubleLog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatLog-testFloatLog.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -356,6 +408,34 @@ libLog_la-zloga.lo: zloga.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLog_la_CFLAGS) $(CFLAGS) -c -o libLog_la-zloga.lo `test -f 'zloga.c' || echo '$(srcdir)/'`zloga.c +testDoubleLog-testDoubleLog.o: testDoubleLog.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLog_CFLAGS) $(CFLAGS) -MT testDoubleLog-testDoubleLog.o -MD -MP -MF $(DEPDIR)/testDoubleLog-testDoubleLog.Tpo -c -o testDoubleLog-testDoubleLog.o `test -f 'testDoubleLog.c' || echo '$(srcdir)/'`testDoubleLog.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLog-testDoubleLog.Tpo $(DEPDIR)/testDoubleLog-testDoubleLog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLog.c' object='testDoubleLog-testDoubleLog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLog_CFLAGS) $(CFLAGS) -c -o testDoubleLog-testDoubleLog.o `test -f 'testDoubleLog.c' || echo '$(srcdir)/'`testDoubleLog.c + +testDoubleLog-testDoubleLog.obj: testDoubleLog.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLog_CFLAGS) $(CFLAGS) -MT testDoubleLog-testDoubleLog.obj -MD -MP -MF $(DEPDIR)/testDoubleLog-testDoubleLog.Tpo -c -o testDoubleLog-testDoubleLog.obj `if test -f 'testDoubleLog.c'; then $(CYGPATH_W) 'testDoubleLog.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLog.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLog-testDoubleLog.Tpo $(DEPDIR)/testDoubleLog-testDoubleLog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLog.c' object='testDoubleLog-testDoubleLog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLog_CFLAGS) $(CFLAGS) -c -o testDoubleLog-testDoubleLog.obj `if test -f 'testDoubleLog.c'; then $(CYGPATH_W) 'testDoubleLog.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLog.c'; fi` + +testFloatLog-testFloatLog.o: testFloatLog.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLog_CFLAGS) $(CFLAGS) -MT testFloatLog-testFloatLog.o -MD -MP -MF $(DEPDIR)/testFloatLog-testFloatLog.Tpo -c -o testFloatLog-testFloatLog.o `test -f 'testFloatLog.c' || echo '$(srcdir)/'`testFloatLog.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatLog-testFloatLog.Tpo $(DEPDIR)/testFloatLog-testFloatLog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatLog.c' object='testFloatLog-testFloatLog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLog_CFLAGS) $(CFLAGS) -c -o testFloatLog-testFloatLog.o `test -f 'testFloatLog.c' || echo '$(srcdir)/'`testFloatLog.c + +testFloatLog-testFloatLog.obj: testFloatLog.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLog_CFLAGS) $(CFLAGS) -MT testFloatLog-testFloatLog.obj -MD -MP -MF $(DEPDIR)/testFloatLog-testFloatLog.Tpo -c -o testFloatLog-testFloatLog.obj `if test -f 'testFloatLog.c'; then $(CYGPATH_W) 'testFloatLog.c'; else $(CYGPATH_W) '$(srcdir)/testFloatLog.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatLog-testFloatLog.Tpo $(DEPDIR)/testFloatLog-testFloatLog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatLog.c' object='testFloatLog-testFloatLog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLog_CFLAGS) $(CFLAGS) -c -o testFloatLog-testFloatLog.obj `if test -f 'testFloatLog.c'; then $(CYGPATH_W) 'testFloatLog.c'; else $(CYGPATH_W) '$(srcdir)/testFloatLog.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -410,6 +490,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -437,6 +590,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: @@ -469,8 +624,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -528,19 +683,20 @@ uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkglibLTLIBRARIES install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-pkglibLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/elementaryFunctions/log/clogs.c b/src/elementaryFunctions/log/clogs.c index 54b33d13..44cf32a7 100644 --- a/src/elementaryFunctions/log/clogs.c +++ b/src/elementaryFunctions/log/clogs.c @@ -1,18 +1,18 @@ /* -** -*- C -*- -** -** clogs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Apr 20 14:29:12 2007 jofret -** Last update Fri Apr 20 14:35:03 2007 jofret -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include "log.h" floatComplex clogs(floatComplex in) { /* FIXME : Implementation */ - return FloatComplex(0, 0); + return in; } diff --git a/src/elementaryFunctions/log/dloga.c b/src/elementaryFunctions/log/dloga.c index 35aabcad..e5f7490d 100644 --- a/src/elementaryFunctions/log/dloga.c +++ b/src/elementaryFunctions/log/dloga.c @@ -1,20 +1,20 @@ /* -** -*- C -*- -** -** dloga.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Sep 7 10:31:35 2007 bruno -** Last update Mon Oct 22 09:51:49 2007 bruno -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include "log.h" void dloga(double* x, int size, double* y) { int i = 0; for (i = 0; i < size; ++i) { - y[i] = slogs(x[i]); + y[i] = dlogs(x[i]); } } diff --git a/src/elementaryFunctions/log/slogs.c b/src/elementaryFunctions/log/slogs.c index a40372e7..f8e7b61b 100644 --- a/src/elementaryFunctions/log/slogs.c +++ b/src/elementaryFunctions/log/slogs.c @@ -1,18 +1,18 @@ /* -** -*- C -*- -** -** slogs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Apr 20 14:25:04 2007 jofret -** Last update Fri Apr 20 14:46:34 2007 jofret -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include <math.h> #include "log.h" float slogs(float in) { - return (log(in)); + return (logf(in)); } diff --git a/src/elementaryFunctions/log/testDoubleLog.c b/src/elementaryFunctions/log/testDoubleLog.c new file mode 100644 index 00000000..471d3544 --- /dev/null +++ b/src/elementaryFunctions/log/testDoubleLog.c @@ -0,0 +1,36 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "testLog.h" + +void dlogsTest(void) { + /* FIXME : Implement some test here ... */ + printf(">> Double scalar\n"); + printf("dlogs(0) = %e\n", dlogs(0.0)); +} + +int testLog(void) { + printf("\n>>>> Double Logarithm Tests\n"); + dlogsTest(); + /* FIXME : Implement some test here ... */ + /* + zlogsTest(); + dlogaTest(); + zlogaTest(); + */ + return 0; +} + +int main(void) { + assert(testLog() == 0); + return 0; +} diff --git a/src/elementaryFunctions/log/testFloatLog.c b/src/elementaryFunctions/log/testFloatLog.c new file mode 100644 index 00000000..d47398f9 --- /dev/null +++ b/src/elementaryFunctions/log/testFloatLog.c @@ -0,0 +1,36 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "testLog.h" + +void slogsTest(void) { + /* FIXME : Implement some test here ... */ + printf(">> Float scalar\n"); + printf("slogs(0) = %f\n", slogs(0.0f)); +} + +int testLog(void) { + printf("\n>>>> Float Logarithm Tests\n"); + slogsTest(); + /* FIXME : Implement some test here ... */ + /* + clogsTest(); + slogaTest(); + clogaTest(); + */ + return 0; +} + +int main(void) { + assert(testLog() == 0); + return 0; +} diff --git a/src/elementaryFunctions/log/testLog.h b/src/elementaryFunctions/log/testLog.h new file mode 100644 index 00000000..d09851e4 --- /dev/null +++ b/src/elementaryFunctions/log/testLog.h @@ -0,0 +1,38 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#ifndef _TESTLOG_H_ +#define _TESTLOG_H_ + +#include <stdio.h> +#include <assert.h> +#include "log.h" + +void slogsTest(void); + +void dlogsTest(void); + +void clogsTest(void); + +void zlogsTest(void); + +void slogaTest(void); + +void dlogaTest(void); + +void clogaTest(void); + +void zlogaTest(void); + +int testLog(void); + +#endif /* ! _TESTLOG_H_ */ diff --git a/src/elementaryFunctions/log/zlogs.c b/src/elementaryFunctions/log/zlogs.c index 3283048a..4b6dab26 100644 --- a/src/elementaryFunctions/log/zlogs.c +++ b/src/elementaryFunctions/log/zlogs.c @@ -1,18 +1,18 @@ /* -** -*- C -*- -** -** zlogs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Apr 20 14:31:56 2007 jofret -** Last update Fri Apr 20 14:34:52 2007 jofret -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include "log.h" doubleComplex zlogs(doubleComplex in) { /* FIXME : Implementation */ - return DoubleComplex(0, 0); + return in; } |