mirror of https://gitlab.com/rnger/amath
Release 1.7.0
This commit is contained in:
parent
87f0d88b26
commit
a301c85e15
|
@ -2,6 +2,7 @@
|
|||
*.kdev4
|
||||
*.vcxproj.user
|
||||
*Debug/*
|
||||
*x64/*
|
||||
*.o
|
||||
*.obj
|
||||
*.a
|
||||
|
|
2
HISTORY
2
HISTORY
|
@ -2,7 +2,7 @@
|
|||
--- amath change history ---
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
v1.7.0 February 28 2017
|
||||
v1.7.0 March 12 2017
|
||||
- Introduce scientific notation.
|
||||
- Introduce Not a Number (NaN).
|
||||
- Fixed bugs related to infinity (Inf).
|
||||
|
|
6
LICENSE
6
LICENSE
|
@ -4,12 +4,6 @@ Copyright (c) 2007 The NetBSD Foundation, Inc.
|
|||
Copyright (c) 1990, 1993 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
This code is derived from software written by Stephen L. Moshier.
|
||||
It is redistributed by the NetBSD Foundation by permission of the author.
|
||||
|
||||
This code is derived from software contributed to Berkeley by
|
||||
Mike Hibler and Chris Torek.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
|
|
36
Makefile
36
Makefile
|
@ -11,8 +11,11 @@ LPATHS = -Lsrc/lib/static -Lsrc/clib/static -Lsrc/real/static -Lsrc/cplex/stat
|
|||
FLXCAT = build/flexcat/flexcat
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0755
|
||||
INSTALLP = install -m 0755
|
||||
INSTALLM = install -m 0644
|
||||
PREFIX = /usr
|
||||
INSTDIRP = ${DESTDIR}${PREFIX}/bin
|
||||
INSTDIRM = ${DESTDIR}${PREFIX}/share/man/man1
|
||||
|
||||
all: shared-app
|
||||
app: appmain functions statement appsystem
|
||||
|
@ -48,25 +51,15 @@ amathc:
|
|||
amathcplex:
|
||||
cd src/cplex && ${MAKE}
|
||||
|
||||
catalogsa:
|
||||
localize:
|
||||
cd build/flexcat && ${MAKE}
|
||||
${FLXCAT} text/keyword.cd src/localize/kword.h=text/keyword.sd
|
||||
${FLXCAT} text/help.cd src/localize/help.h=text/help.sd
|
||||
${FLXCAT} text/ident.cd src/localize/ident.h=text/ident.sd
|
||||
${FLXCAT} text/text.cd src/localize/text.h=text/text.sd
|
||||
|
||||
catalogsu:
|
||||
iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-help.ct >utext/dk-help.dict
|
||||
iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-ident.ct >utext/dk-ident.dict
|
||||
iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-text.ct >utext/dk-text.dict
|
||||
iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict
|
||||
|
||||
catalogsw:
|
||||
iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-help.ct >utext/dk-help.dict
|
||||
iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-ident.ct >utext/dk-ident.dict
|
||||
iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-text.ct >utext/dk-text.dict
|
||||
iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict
|
||||
|
||||
amigacatalogs:
|
||||
catalogs:
|
||||
cd build/flexcat && ${MAKE}
|
||||
${MKDIR} dist/catalog/english
|
||||
${FLXCAT} text/help.cd catalog/english/amath-help.ct CATALOG dist/catalog/english/amath-help.catalog
|
||||
${FLXCAT} text/ident.cd catalog/english/amath-ident.ct CATALOG dist/catalog/english/amath-ident.catalog
|
||||
|
@ -92,16 +85,18 @@ static-app: src/main.o
|
|||
${CC} ${CFLAGS} -s src/main.o -o amath ${LPATHS} ${LFLAGS}
|
||||
|
||||
.PHONY: test
|
||||
test: static-app
|
||||
test: amath
|
||||
LD_LIBRARY_PATH=src/clib/:src/lib:src/cplex:scr/real
|
||||
./amath test
|
||||
|
||||
.PHONY: install
|
||||
install: amath
|
||||
install: shared-app
|
||||
cd src/lib && ${MAKE} install
|
||||
cd src/clib && ${MAKE} install
|
||||
cd src/real && ${MAKE} install
|
||||
cd src/cplex && ${MAKE} install
|
||||
${INSTALL} amath ${DESTDIR}${PREFIX}/bin
|
||||
${INSTALLP} amath ${INSTDIRP}/amath
|
||||
${INSTALLM} amath.1 ${INSTDIRM}/amath.1
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
|
@ -109,8 +104,10 @@ uninstall:
|
|||
cd src/clib && ${MAKE} uninstall
|
||||
cd src/real && ${MAKE} uninstall
|
||||
cd src/cplex && ${MAKE} uninstall
|
||||
${DEL} ${DESTDIR}${PREFIX}/bin/amath
|
||||
${DEL} ${INSTDIRP}/amath
|
||||
${DEL} ${INSTDIRM}/amath.1
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
cd src/lib && ${MAKE} clean
|
||||
cd src/clib && ${MAKE} clean
|
||||
|
@ -120,5 +117,6 @@ clean:
|
|||
cd src/system && ${MAKE} clean
|
||||
cd src/main/function && ${MAKE} clean
|
||||
cd src/main/statement && ${MAKE} clean
|
||||
cd build/flexcat && ${MAKE} clean
|
||||
${DEL} src/main.o amath
|
||||
|
||||
|
|
|
@ -0,0 +1,173 @@
|
|||
.TH "amath" 1 "Wed Mar 1 2017" "Version 1.7.0" "amath" \" -*- nroff -*-
|
||||
.ad l
|
||||
.nh
|
||||
.SH NAME
|
||||
amath \- Statements and functions
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fCamath [expression]\fP
|
||||
|
||||
.SH Description
|
||||
amath(1) features a case sensitive command line interface, internal
|
||||
IEEE 754 calculations with 15 significant digits, calculations with
|
||||
real and complex numbers, variables and user defined functions,
|
||||
logarithmic and exponential functions, trigonometric and hyperbolic
|
||||
function and selected mathematical constants and rounding functions.
|
||||
|
||||
.SH "Statements"
|
||||
.PP
|
||||
.nf
|
||||
clear Clear console window
|
||||
def Define function
|
||||
delete Delete variable or function
|
||||
digits Set number of significant digits
|
||||
eval Evaluate arithmetic expression
|
||||
execute Execute statements in a file
|
||||
functions Show list of user defined functions
|
||||
input Change numeral input system
|
||||
help Show basic help text
|
||||
output Change numeral output system
|
||||
list Show content of a directory
|
||||
show Show content of a file
|
||||
load Load variable and functions from file
|
||||
save Save variable and functions to file
|
||||
variables Show list of variables
|
||||
version Show version string
|
||||
memory Show internal memory usage
|
||||
exit Exit program
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Operators"
|
||||
.PP
|
||||
.nf
|
||||
+ Mathematical addition.
|
||||
- Mathematical subtraction.
|
||||
* Mathematical multiplication.
|
||||
/ Mathematical division.
|
||||
^ Mathematical exponentiation.
|
||||
= Assignment of variable values.
|
||||
| Absolute value of number.
|
||||
|
||||
.SH "Variables and constant"
|
||||
.PP
|
||||
.nf
|
||||
pi Trigonometric constant
|
||||
e Euler's number
|
||||
i Imaginary unit
|
||||
ins Result of last calculation
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Base functions"
|
||||
.PP
|
||||
.nf
|
||||
abs Absolute value of number
|
||||
sgn Mathematical signum function
|
||||
round Round to nearest integer number
|
||||
trunc Discard fraction part of number
|
||||
floor Mathematical floor function
|
||||
ceil Mathematical ceiling function
|
||||
sqrt Square root function (exp 1/2)
|
||||
cbrt Cube root function (exp 1/3)
|
||||
lb Binary logarithm function (base 2)
|
||||
ln Natural logarithm function (base e)
|
||||
lg Common logarithm function (base 10)
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Trigonometric functions"
|
||||
.PP
|
||||
.nf
|
||||
sin Trigonometric sine function
|
||||
cos Trigonometric cosine function
|
||||
tan Trigonometric tangent function
|
||||
cot Trigonometric cotangent function
|
||||
sec Trigonometric secant function
|
||||
csc Trigonometric cosecant function
|
||||
arcsin Inverse trigonometric sine function
|
||||
arccos Inverse trigonometric cosine function
|
||||
arctan Inverse trigonometric tangent function
|
||||
arccot Inverse trigonometric cotangent function
|
||||
arcsec Inverse trigonometric secant function
|
||||
arccsc Inverse trigonometric cosecant function
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Hyperbolic functions"
|
||||
.PP
|
||||
.nf
|
||||
sinh Hyperbolic sine function
|
||||
cosh Hyperbolic cosine function
|
||||
tanh Hyperbolic tangent function
|
||||
coth Hyperbolic cotangent function
|
||||
sech Hyperbolic secant function
|
||||
csch Hyperbolic cosecant function
|
||||
arcsinh Inverse hyperbolic sine function
|
||||
arccosh Inverse hyperbolic cosine function
|
||||
arctanh Inverse hyperbolic tangent function
|
||||
arccoth Inverse hyperbolic cotangent function
|
||||
arcsech Inverse hyperbolic secant function
|
||||
arccsch Inverse hyperbolic cosecant function
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Early trigonometric functions"
|
||||
.PP
|
||||
.nf
|
||||
ver Versed sine function
|
||||
vcs Versed cosine function
|
||||
cvs Coversed sine function
|
||||
cvc Coversed cosine function
|
||||
hv Haversed sine function
|
||||
hvc Haversed cosine function
|
||||
hcv Hacoversed sine function
|
||||
hcc Hacoversed cosine function
|
||||
arcver Inverse versed sine function
|
||||
arcvcs Inverse versed cosine function
|
||||
arccvs Inverse coversed sine function
|
||||
arccvc Inverse coversed cosine function
|
||||
archv Inverse haversed sine function
|
||||
archvc Inverse haversed cosine function
|
||||
archcv Inverse hacoversed sine function
|
||||
archcc Inverse hacoversed cosine function
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Example script"
|
||||
.PP
|
||||
.nf
|
||||
round(1.5461);round(-1.5461);
|
||||
ceil(43.5461);ceil(-43.5461);
|
||||
floor(39.9531);floor(-39.9531);
|
||||
trunc(23.827);trunc(-23.827);
|
||||
sqrt(100);sqrt(52.23);
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Example script with functions"
|
||||
.PP
|
||||
.nf
|
||||
f(x)=x*2+1;
|
||||
g(y)=y^2+y*1.5+2;
|
||||
a=2;b=3;c=a+b;
|
||||
vars;funcs;
|
||||
f(2.2);c+1.1;
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "Example script with complex numbers"
|
||||
.PP
|
||||
.nf
|
||||
cos(1+2i);
|
||||
sin(1+2i);
|
||||
tan(1+2i);
|
||||
coth(1+2i);
|
||||
sech(1+2i);
|
||||
csch(1+2i);
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "See also"
|
||||
.PP
|
||||
amathc(3), amathr(3), amathi(3)
|
|
@ -771,7 +771,7 @@ WARN_LOGFILE = doxygen.warn
|
|||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = app lib
|
||||
INPUT = src
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
|
@ -2376,7 +2376,7 @@ PLANTUML_INCLUDE_PATH =
|
|||
# Minimum value: 0, maximum value: 10000, default value: 50.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_GRAPH_MAX_NODES = 100
|
||||
DOT_GRAPH_MAX_NODES = 200
|
||||
|
||||
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
|
||||
# generated by dot. A depth value of 3 means that only nodes reachable from the
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
Package: amath
|
||||
Version: 1.7.0
|
||||
Architecture: amd64
|
||||
Maintainer: Carsten Larsen <cs@innolan.net>
|
||||
Installed-Size: 259
|
||||
Depends: libc6
|
||||
Section: math
|
||||
Essential: no
|
||||
Priority: optional
|
||||
Homepage: http://amath.innolan.net
|
||||
Built-Using: gcc-5.4
|
||||
Description: Simple command line calculator
|
||||
Features a case sensitive command line interface, internal IEEE 754
|
||||
calculations with 15 significant digits, calculations with real and
|
||||
complex numbers, variables and user defined functions, logarithmic
|
||||
and exponential functions, trigonometric and hyperbolic function
|
||||
and selected mathematical constants and rounding functions.
|
|
@ -1,17 +0,0 @@
|
|||
Package: amath
|
||||
Version: 1.7.0
|
||||
Architecture: i386
|
||||
Maintainer: Carsten Larsen <cs@innolan.net>
|
||||
Installed-Size: 262
|
||||
Depends: libc6
|
||||
Section: math
|
||||
Essential: no
|
||||
Priority: optional
|
||||
Homepage: http://amath.innolan.net
|
||||
Built-Using: gcc-5.4
|
||||
Description: Simple command line calculator
|
||||
Features a case sensitive command line interface, internal IEEE 754
|
||||
calculations with 15 significant digits, calculations with real and
|
||||
complex numbers, variables and user defined functions, logarithmic
|
||||
and exponential functions, trigonometric and hyperbolic function
|
||||
and selected mathematical constants and rounding functions.
|
|
@ -0,0 +1,62 @@
|
|||
all: flexcat
|
||||
|
||||
CFLAGS += -I. -Wall
|
||||
|
||||
asprintf.o: asprintf.c
|
||||
${CC} ${CFLAGS} -c asprintf.c
|
||||
|
||||
createcat.o: createcat.c
|
||||
${CC} ${CFLAGS} -c createcat.c
|
||||
|
||||
createcatsrc.o: createcatsrc.c
|
||||
${CC} ${CFLAGS} -c createcatsrc.c
|
||||
|
||||
createct.o: createct.c
|
||||
${CC} ${CFLAGS} -c createct.c
|
||||
|
||||
globals.o: globals.c
|
||||
${CC} ${CFLAGS} -c globals.c
|
||||
|
||||
locale_other.o: locale_other.c
|
||||
${CC} ${CFLAGS} -c locale_other.c
|
||||
|
||||
main.o: main.c
|
||||
${CC} ${CFLAGS} -c main.c
|
||||
|
||||
openlibs.o: openlibs.c
|
||||
${CC} ${CFLAGS} -c openlibs.c
|
||||
|
||||
readprefs.o: readprefs.c
|
||||
${CC} ${CFLAGS} -c readprefs.c
|
||||
|
||||
scancd.o: scancd.c
|
||||
${CC} ${CFLAGS} -c scancd.c
|
||||
|
||||
scanct.o: scanct.c
|
||||
${CC} ${CFLAGS} -c scanct.c
|
||||
|
||||
scanpo.o: scanpo.c
|
||||
${CC} ${CFLAGS} -c scanpo.c
|
||||
|
||||
showfuncs.o: showfuncs.c
|
||||
${CC} ${CFLAGS} -c showfuncs.c
|
||||
|
||||
strptime.o: strptime.c
|
||||
${CC} ${CFLAGS} -c strptime.c
|
||||
|
||||
swapfuncs.o: swapfuncs.c
|
||||
${CC} ${CFLAGS} -c swapfuncs.c
|
||||
|
||||
utils.o: utils.c
|
||||
${CC} ${CFLAGS} -c utils.c
|
||||
|
||||
vastubs.o: vastubs.c
|
||||
${CC} ${CFLAGS} -c vastubs.c
|
||||
|
||||
|
||||
flexcat: asprintf.o createcat.o createcatsrc.o createct.o globals.o locale_other.o main.o openlibs.o readprefs.o scancd.o scanct.o scanpo.o showfuncs.o strptime.o swapfuncs.o utils.o vastubs.o
|
||||
${CC} ${CFLAGS} -o flexcat asprintf.o createcat.o createcatsrc.o createct.o globals.o locale_other.o main.o openlibs.o readprefs.o scancd.o scanct.o scanpo.o showfuncs.o strptime.o swapfuncs.o utils.o vastubs.o -lm
|
||||
|
||||
clean:
|
||||
rm -f asprintf.o createcat.o createcatsrc.o createct.o globals.o locale_other.o main.o openlibs.o readprefs.o scancd.o scanct.o scanpo.o showfuncs.o strptime.o swapfuncs.o utils.o vastubs.o flexcat
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
HDRS='
|
||||
createcat.h
|
||||
createcatsrc.h
|
||||
createct.h
|
||||
FlexCat_cat.h
|
||||
FlexCat_cat_other.h
|
||||
flexcat.h
|
||||
globals.h
|
||||
openlibs.h
|
||||
readprefs.h
|
||||
scancd.h
|
||||
scanct.h
|
||||
scanpo.h
|
||||
SDI_compiler.h
|
||||
showfuncs.h
|
||||
swapfuncs.h
|
||||
utils.h
|
||||
version.h
|
||||
'
|
||||
|
||||
SRCS='
|
||||
asprintf.c
|
||||
createcat.c
|
||||
createcatsrc.c
|
||||
createct.c
|
||||
globals.c
|
||||
locale_other.c
|
||||
main.c
|
||||
openlibs.c
|
||||
readprefs.c
|
||||
scancd.c
|
||||
scanct.c
|
||||
scanpo.c
|
||||
showfuncs.c
|
||||
strptime.c
|
||||
swapfuncs.c
|
||||
utils.c
|
||||
vastubs.c
|
||||
'
|
||||
|
||||
if make -v 2>&1 | grep GNU > /dev/null 2>&1 ; then
|
||||
echo "make(1) is GNU make."
|
||||
BSD=false
|
||||
elif [ -f /usr/share/mk/bsd.prog.mk ] ; then
|
||||
echo "Found bsd.prog.mk, will use it."
|
||||
BSD=true
|
||||
else
|
||||
echo "Defaulting to plain makefile"
|
||||
BSD=false
|
||||
fi
|
||||
|
||||
if $BSD ; then
|
||||
(
|
||||
echo '# BSD-style Makefile generated by configure'
|
||||
echo 'PROG = flexcat'
|
||||
for f in ${SRCS}
|
||||
do
|
||||
echo "SRCS += ${f}"
|
||||
done
|
||||
|
||||
echo 'NO_MAN = not_yet'
|
||||
echo 'LDADD += -lm'
|
||||
echo 'WARNS ?= 6'
|
||||
echo '.include <bsd.prog.mk>'
|
||||
) > Makefile
|
||||
|
||||
msg=", remember to run 'make depend'"
|
||||
else
|
||||
(
|
||||
echo '# Portable Makefile generated by configure'
|
||||
echo ''
|
||||
echo 'all: flexcat'
|
||||
echo ''
|
||||
echo "CFLAGS += -I. -Wall"
|
||||
echo ''
|
||||
|
||||
for f in ${HDRS}
|
||||
do
|
||||
b=`basename $f .h`
|
||||
i=`sed -n -e '/#include.*"/{
|
||||
s/"$//
|
||||
s/.*"//
|
||||
p
|
||||
}' $f | sort -u`
|
||||
if [ "x${i}" != "x" ] ; then
|
||||
echo "${b}.h: " ${i}
|
||||
echo " touch ${b}.h"
|
||||
echo
|
||||
fi
|
||||
done
|
||||
|
||||
l=""
|
||||
for f in ${SRCS}
|
||||
do
|
||||
b=`basename $f .c`
|
||||
i=`sed -n -e '/#include.*"/{
|
||||
s/"$//
|
||||
s/.*"//
|
||||
p
|
||||
}' $f | sort -u`
|
||||
echo "${b}.o: ${b}.c" ${i}
|
||||
echo
|
||||
l="${l} ${b}.o"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "flexcat: ${l}"
|
||||
echo " \${CC} \${CFLAGS} -o flexcat ${l} -lm"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " rm -f ${l} flexcat"
|
||||
echo
|
||||
echo "depend:"
|
||||
echo " @echo Dependencies already done"
|
||||
) > Makefile
|
||||
fi
|
||||
|
||||
echo "Makefile generated${msg}"
|
228
builddeb
228
builddeb
|
@ -1,75 +1,199 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Build a debian package for amd64
|
||||
set -e
|
||||
|
||||
version="1.7.0"
|
||||
|
||||
echo "Building amath ${version} for Debian ..."
|
||||
rm -Rf amath
|
||||
build_package () {
|
||||
|
||||
# Build
|
||||
sh configure
|
||||
rm -Rf amath
|
||||
rm -f amath-${version}_$1.deb
|
||||
sh configure CFLAGS=$2
|
||||
make clean
|
||||
|
||||
echo "Building $3 bit package of amath ${version} for Debian ..."
|
||||
make
|
||||
mv amath amath.tmp
|
||||
make clean
|
||||
|
||||
# Create filesystem layout
|
||||
rm -Rf amath
|
||||
|
||||
mkdir -p amath/DEBIAN
|
||||
mkdir -p amath/usr/bin
|
||||
mkdir -p amath/usr/share/doc/amath
|
||||
mkdir -p amath/usr/local/share/amath
|
||||
mkdir -m 755 amath
|
||||
mkdir -m 755 amath/DEBIAN
|
||||
mkdir -m 755 amath/usr/
|
||||
mkdir -m 755 amath/usr/bin
|
||||
mkdir -m 755 amath/usr/lib
|
||||
mkdir -m 755 amath/usr/lib/pkgconfig
|
||||
mkdir -m 755 amath/usr/include
|
||||
mkdir -m 755 amath/usr/share
|
||||
mkdir -m 755 amath/usr/share/amath
|
||||
mkdir -m 755 amath/usr/share/man
|
||||
mkdir -m 755 amath/usr/share/man/man1
|
||||
mkdir -m 755 amath/usr/share/man/man3
|
||||
mkdir -m 755 amath/usr/share/doc
|
||||
mkdir -m 755 amath/usr/share/doc/amath
|
||||
|
||||
# Copy binaries
|
||||
mv amath.tmp amath/usr/bin/amath
|
||||
chmod 0755 amath/usr/bin/amath
|
||||
mv src/lib/static/libamathapp.a amath/usr/lib/libamathapp.a
|
||||
chmod 0644 amath/usr/lib/libamathapp.a
|
||||
mv src/lib/libamathapp.so amath/usr/lib/libamathapp.so.${version}
|
||||
chmod 0644 amath/usr/lib/libamathapp.so.${version}
|
||||
mv src/clib/static/libamathc.a amath/usr/lib/libamathc.a
|
||||
chmod 0644 amath/usr/lib/libamathc.a
|
||||
mv src/clib/libamathc.so amath/usr/lib/libamathc.so.${version}
|
||||
chmod 0644 amath/usr/lib/libamathc.so.${version}
|
||||
mv src/real/static/libamath.a amath/usr/lib/libamath.a
|
||||
chmod 0644 amath/usr/lib/libamath.a
|
||||
mv src/real/libamath.so amath/usr/lib/libamath.so.${version}
|
||||
chmod 0644 amath/usr/lib/libamath.so.${version}
|
||||
mv src/cplex/static/libamathcplex.a amath/usr/lib/libamathcplex.a
|
||||
chmod 0644 amath/usr/lib/libamathcplex.a
|
||||
mv src/cplex/libamathcplex.so amath/usr/lib/libamathcplex.so.${version}
|
||||
chmod 0644 amath/usr/lib/libamathcplex.so.${version}
|
||||
|
||||
# Copy pkg-config files
|
||||
cp src/lib/amatha.pc amath/usr/lib/pkgconfig/amatha.pc
|
||||
cp src/clib/amathc.pc amath/usr/lib/pkgconfig/amathc.pc
|
||||
cp src/real/amathr.pc amath/usr/lib/pkgconfig/amathr.pc
|
||||
cp src/cplex/amathi.pc amath/usr/lib/pkgconfig/amathi.pc
|
||||
chmod 644 amath/usr/lib/pkgconfig/*
|
||||
|
||||
# Copy includes
|
||||
cp src/amath.h amath/usr/include/amath.h
|
||||
cp src/amathc.h amath/usr/include/amathc.h
|
||||
cp src/amatht.h amath/usr/include/amatht.h
|
||||
cp src/complex.h amath/usr/include/amathi.h
|
||||
chmod 644 amath/usr/include/*
|
||||
|
||||
# Copy documentation
|
||||
cp LICENSE amath/usr/share/doc/amath/
|
||||
cp HISTORY amath/usr/share/doc/amath/
|
||||
cp build/debian/README amath/usr/share/doc/amath/
|
||||
gzip --best -n amath/usr/share/doc/amath/HISTORY
|
||||
cp README amath/usr/share/doc/amath/
|
||||
gzip --best -n amath/usr/share/doc/amath/README
|
||||
chmod 644 amath/usr/share/doc/amath/*
|
||||
|
||||
# Copy man pages
|
||||
cp amath.1 amath/usr/share/man/man1/amath.1
|
||||
cp src/clib/amathc.3 amath/usr/share/man/man3/amathc.3
|
||||
cp src/real/amathr.3 amath/usr/share/man/man3/amathr.3
|
||||
cp src/cplex/amathi.3 amath/usr/share/man/man3/amathi.3
|
||||
|
||||
gzip --best -n amath/usr/share/man/man1/amath.1
|
||||
gzip --best -n amath/usr/share/man/man3/amathc.3
|
||||
gzip --best -n amath/usr/share/man/man3/amathr.3
|
||||
gzip --best -n amath/usr/share/man/man3/amathi.3
|
||||
chmod 644 amath/usr/share/man/man1/*
|
||||
chmod 644 amath/usr/share/man/man3/*
|
||||
|
||||
# Copy scripts
|
||||
cp script/* amath/usr/local/share/amath/
|
||||
cp script/* amath/usr/share/amath/
|
||||
chmod 644 amath/usr/share/amath/*
|
||||
|
||||
# Make the package
|
||||
cp build/debian/control-amd64 amath/DEBIAN/control
|
||||
dpkg-deb --build amath
|
||||
mv amath.deb amath-${version}_amd64.deb
|
||||
# Create control file
|
||||
{
|
||||
echo "Package: amath"
|
||||
echo "Version: ${version}"
|
||||
echo "Architecture: $1"
|
||||
echo "Maintainer: Carsten Larsen <cs@innolan.net>"
|
||||
echo "Installed-Size: $4"
|
||||
echo "Depends: libc6"
|
||||
echo "Section: math"
|
||||
echo "Priority: optional"
|
||||
echo "Homepage: http://amath.innolan.net"
|
||||
echo "Built-Using: gcc-5.4"
|
||||
echo "Description: Simple command line calculator"
|
||||
echo " Features a case sensitive command line interface, internal IEEE 754"
|
||||
echo " calculations with 15 significant digits, calculations with real and"
|
||||
echo " complex numbers, variables and user defined functions, logarithmic"
|
||||
echo " and exponential functions, trigonometric and hyperbolic function"
|
||||
echo " and selected mathematical constants and rounding functions."
|
||||
} >amath/DEBIAN/control
|
||||
chmod 0755 amath/DEBIAN/control
|
||||
|
||||
# Build a debian package for i386
|
||||
# Create license file
|
||||
{
|
||||
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
||||
echo "Upstream-Name: amath"
|
||||
echo "Source: http://amath.innolan.net"
|
||||
echo
|
||||
echo "Files: *"
|
||||
echo "Copyright: 2014-2017 Carsten Sonne Larsen <cs@innolan.net>"
|
||||
echo " 2007 The NetBSD Foundation, Inc."
|
||||
echo " 1990, 1993 The Regents of the University of California."
|
||||
echo "License: BSD-2-Clause"
|
||||
echo " Redistribution and use in source and binary forms, with or without"
|
||||
echo " modification, are permitted provided that the following conditions are met:"
|
||||
echo " ."
|
||||
echo " Redistributions of source code must retain the above copyright notice, this"
|
||||
echo " list of conditions and the following disclaimer."
|
||||
echo " ."
|
||||
echo " Redistributions in binary form must reproduce the above copyright notice,"
|
||||
echo " this list of conditions and the following disclaimer in the documentation"
|
||||
echo " and/or other materials provided with the distribution."
|
||||
echo " ."
|
||||
echo " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""
|
||||
echo " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"
|
||||
echo " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
|
||||
echo " DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE"
|
||||
echo " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"
|
||||
echo " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"
|
||||
echo " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"
|
||||
echo " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
|
||||
echo " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"
|
||||
echo " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
} >amath/DEBIAN/copyright
|
||||
gzip --best -n amath/DEBIAN/copyright
|
||||
chmod 0755 amath/DEBIAN/copyright.gz
|
||||
|
||||
# Create change log
|
||||
{
|
||||
echo "amath (${version}) unstable; urgency=low"
|
||||
echo
|
||||
echo " * Initial Debian Release."
|
||||
echo
|
||||
echo " -- Carsten Larsen <cs@innolan.net> Sat, 04 Mar 2017 19:49:07 +0100"
|
||||
} >amath/DEBIAN/changelog.Debian
|
||||
gzip --best -n amath/DEBIAN/changelog.Debian
|
||||
chmod 0755 amath/DEBIAN/changelog.Debian.gz
|
||||
|
||||
{
|
||||
echo "libamath ${version}"
|
||||
echo "libamathc ${version}"
|
||||
echo "libamathcplex ${version}"
|
||||
echo "libamathapp ${version}"
|
||||
} >amath/DEBIAN/shlibs
|
||||
chmod 0644 amath/DEBIAN/shlibs
|
||||
|
||||
# Create post install script
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "ln -s /usr/lib/libamathapp.so.${version} /usr/lib/libamathapp.so"
|
||||
echo "ln -s /usr/lib/libamathc.so.${version} /usr/lib/libamathc.so"
|
||||
echo "ln -s /usr/lib/libamath.so.${version} /usr/lib/libamath.so"
|
||||
echo "ln -s /usr/lib/libamathcplex.so.${version} /usr/lib/libamathcplex.so"
|
||||
echo "ldconfig"
|
||||
} >amath/DEBIAN/postinst
|
||||
chmod 0755 amath/DEBIAN/postinst
|
||||
|
||||
# Create post remove script
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ "\$1" = "remove" ]; then"
|
||||
echo "ldconfig"
|
||||
echo "fi"
|
||||
echo "rm -f /usr/lib/libamathapp.so.${version}"
|
||||
echo "rm -f /usr/lib/libamathc.so.${version}"
|
||||
echo "rm -f /usr/lib/libamath.so.${version}"
|
||||
echo "rm -f /usr/lib/libamathcplex.so.${version}"
|
||||
} >amath/DEBIAN/postrm
|
||||
chmod 0755 amath/DEBIAN/postrm
|
||||
|
||||
fakeroot dpkg-deb --build amath
|
||||
mv amath.deb amath-${version}_$1.deb
|
||||
rm -Rf amath
|
||||
}
|
||||
|
||||
# Build
|
||||
sh configure cflags="-m32"
|
||||
make clean
|
||||
make
|
||||
mv amath amath.tmp
|
||||
make clean
|
||||
|
||||
# Create filesystem layout
|
||||
rm -Rf amath
|
||||
|
||||
mkdir -p amath/DEBIAN
|
||||
mkdir -p amath/usr/bin
|
||||
mkdir -p amath/usr/share/doc/amath
|
||||
mkdir -p amath/usr/local/share/amath
|
||||
|
||||
mv amath.tmp amath/usr/bin/amath
|
||||
|
||||
# Copy documentation
|
||||
cp LICENSE amath/usr/share/doc/amath/
|
||||
cp HISTORY amath/usr/share/doc/amath/
|
||||
cp build/debian/README amath/usr/share/doc/amath/
|
||||
|
||||
# Copy scripts
|
||||
cp script/* amath/usr/local/share/amath/
|
||||
|
||||
# Make the package
|
||||
cp build/debian/control-i386 amath/DEBIAN/control
|
||||
dpkg-deb --build amath
|
||||
mv amath.deb amath-${version}_i386.deb
|
||||
|
||||
# Cleanup
|
||||
#rm -Rf amath
|
||||
build_package 'amd64' '' 64 980
|
||||
build_package 'i386' '-m32' 32 980
|
||||
|
|
71
builddist
71
builddist
|
@ -1,109 +1,56 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
rm -f amath.lha
|
||||
rm -Rf amath
|
||||
rm -Rf dist
|
||||
mkdir dist
|
||||
|
||||
cd build/flexcat
|
||||
./configure
|
||||
make clean
|
||||
make
|
||||
cd ../..
|
||||
|
||||
./configure --disable-test --cflags="-m68000 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --disable-test --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
||||
make clean
|
||||
make static
|
||||
mv amath dist/amath.000
|
||||
make clean
|
||||
./configure --disable-test --cflags="-m68020 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --disable-test --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
||||
make static
|
||||
mv amath dist/amath.020
|
||||
make clean
|
||||
./configure --disable-test --cflags="-m68030 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --disable-test --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
||||
make static
|
||||
mv amath dist/amath.030
|
||||
make clean
|
||||
#./configure --disable-test --cflags="-m68040 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath.040
|
||||
#make clean
|
||||
#./configure --disable-test --cflags="-m68060 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath.060
|
||||
#make clean
|
||||
#./configure --disable-test --cflags="-m68020 -m68881 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath.020f
|
||||
#make clean
|
||||
#./configure --disable-test --cflags="-m68030 -m68881 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath.030f
|
||||
#make clean
|
||||
|
||||
./configure --enable-test --cflags="-m68000 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --enable-test --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
||||
make static
|
||||
mv amath dist/amath-test.000
|
||||
make clean
|
||||
./configure --enable-test --cflags="-m68020 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --enable-test --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
||||
make static
|
||||
mv amath dist/amath-test.020
|
||||
make clean
|
||||
./configure --enable-test --cflags="-m68030 -noixemul" --cross-compile="m68k-amigaos"
|
||||
./configure --enable-test --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
||||
make static
|
||||
mv amath dist/amath-test.030
|
||||
make clean
|
||||
#./configure --enable-test --cflags="-m68040 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath-test.040
|
||||
#make clean
|
||||
#./configure --enable-test --cflags="-m68060 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath-test.060
|
||||
#make clean
|
||||
#./configure --enable-test --cflags="-m68020 -m68881 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath-test.020f
|
||||
#make clean
|
||||
#./configure --enable-test --cflags="-m68030 -m68881 -noixemul" --cross-compile="m68k-amigaos"
|
||||
#make static
|
||||
#mv amath dist/amath-test.030f
|
||||
#make clean
|
||||
|
||||
cd dist
|
||||
touch hashkeys
|
||||
sha1sum amath.000 >>hashkeys
|
||||
sha1sum amath.020 >>hashkeys
|
||||
sha1sum amath.030 >>hashkeys
|
||||
#sha1sum amath.040 >>hashkeys
|
||||
#sha1sum amath.060 >>hashkeys
|
||||
#sha1sum amath.020f >>hashkeys
|
||||
#sha1sum amath.030f >>hashkeys
|
||||
sha1sum amath-test.000 >>hashkeys
|
||||
sha1sum amath-test.020 >>hashkeys
|
||||
sha1sum amath-test.030 >>hashkeys
|
||||
#sha1sum amath-test.040 >>hashkeys
|
||||
#sha1sum amath-test.060 >>hashkeys
|
||||
#sha1sum amath-test.020f >>hashkeys
|
||||
#sha1sum amath-test.030f >>hashkeys
|
||||
sha256sum amath.000 >>hashkeys
|
||||
sha256sum amath.020 >>hashkeys
|
||||
sha256sum amath.030 >>hashkeys
|
||||
#sha256sum amath.040 >>hashkeys
|
||||
#sha256sum amath.060 >>hashkeys
|
||||
#sha256sum amath.020f >>hashkeys
|
||||
#sha256sum amath.030f >>hashkeys
|
||||
sha256sum amath-test.000 >>hashkeys
|
||||
sha256sum amath-test.020 >>hashkeys
|
||||
sha256sum amath-test.030 >>hashkeys
|
||||
#sha256sum amath-test.040 >>hashkeys
|
||||
#sha256sum amath-test.060 >>hashkeys
|
||||
#sha256sum amath-test.020f >>hashkeys
|
||||
#sha256sum amath-test.030f >>hashkeys
|
||||
cd ..
|
||||
|
||||
make amigacatalogs
|
||||
|
||||
make catalogs
|
||||
cp LICENSE dist/
|
||||
cp HISTORY dist/
|
||||
|
||||
|
|
13
buildwin
13
buildwin
|
@ -1,30 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
version="1.7.0"
|
||||
|
||||
echo "Building amath ${version} for Windows ..."
|
||||
|
||||
touch hashkeys
|
||||
rm -f amath-${version}.zip
|
||||
rm -Rf amath
|
||||
rm -Rf dist
|
||||
mkdir dist
|
||||
|
||||
./configure --enable-test --cross-compile="i686-w64-mingw32" --cflags="-D_WIN32" --ldflags="-static -static-libgcc -static-libstdc++"
|
||||
./configure --enable-test --cross-compile="i686-w64-mingw32" CFLAGS="-D_WIN32" LDFLAGS="-static -static-libgcc -static-libstdc++"
|
||||
make clean
|
||||
make static
|
||||
mv amath dist/amath-${version}-x86.exe
|
||||
make clean
|
||||
|
||||
./configure --enable-test --cross-compile="x86_64-w64-mingw32" --cflags="-D_WIN32" --ldflags="-static -static-libgcc -static-libstdc++"
|
||||
./configure --enable-test --cross-compile="x86_64-w64-mingw32" CFLAGS="-D_WIN32" LDFLAGS="-static -static-libgcc -static-libstdc++"
|
||||
make static
|
||||
mv amath dist/amath-${version}-x64.exe
|
||||
make clean
|
||||
|
||||
./configure --enable-test --cross-compile="i686-w64-mingw32" --cflags="-D_WIN32 -DANSICONSOLE" --ldflags="-static -static-libgcc -static-libstdc++"
|
||||
./configure --enable-test --cross-compile="i686-w64-mingw32" CFLAGS="-D_WIN32 -DANSICONSOLE" LDFLAGS="-static -static-libgcc -static-libstdc++"
|
||||
make static
|
||||
mv amath dist/amath-${version}-ansi-x86.exe
|
||||
make clean
|
||||
|
||||
./configure --enable-test --cross-compile="x86_64-w64-mingw32" --cflags="-D_WIN32 -DANSICONSOLE" --ldflags="-static -static-libgcc -static-libstdc++"
|
||||
./configure --enable-test --cross-compile="x86_64-w64-mingw32" CFLAGS="-D_WIN32 -DANSICONSOLE" LDFLAGS="-static -static-libgcc -static-libstdc++"
|
||||
make static
|
||||
mv amath dist/amath-${version}-ansi-x64.exe
|
||||
make clean
|
||||
|
|
|
@ -39,9 +39,8 @@ symtrigon
|
|||
-------------------------------------------------#NEWLINE#sin Trigonometrisk sinus funktion.#NEWLINE#cos Trigonometrisk cosinus funktion.#NEWLINE#tan Trigonometrisk tangent funktion.#NEWLINE#cot Trigonometrisk cotangent funktion.#NEWLINE#sec Trigonometrisk secant funktion.#NEWLINE#csc Trigonometrisk cosecant funktion.#NEWLINE#asin Invers trigonometrisk sinus funktion.#NEWLINE#acos Invers trigonometrisk cosinus funktion.#NEWLINE#atan Invers trigonometrisk tangent funktion.#NEWLINE#acot Invers trigonometrisk cotangent funktion.#NEWLINE#asec Invers trigonometrisk secant funktion.#NEWLINE#acsc Invers trigonometrisk cosecant funktion.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse funktioner kan prefixes med ar eller arc #NEWLINE#i stedet for a.#NEWLINE#
|
||||
symhyper
|
||||
-------------------------------------------------#NEWLINE#sinh Hyperbolsk sinus funktion.#NEWLINE#cosh Hyperbolsk cosinus funktion.#NEWLINE#tanh Hyperbolsk tangent funktion.#NEWLINE#coth Hyperbolsk cotangent funktion.#NEWLINE#sech Hyperbolsk secant funktion.#NEWLINE#csch Hyperbolsk cosecant funktion. #NEWLINE#asinh Invers hyperbolsk sinus funktion.#NEWLINE#acosh Invers hyperbolsk cosinus funktion.#NEWLINE#atanh Invers hyperbolsk tangent funktion.#NEWLINE#acoth Invers hyperbolsk cotangent funktion.#NEWLINE#asech Invers hyperbolsk secant funktion.#NEWLINE#acsch Invers hyperbolsk cosecant funktion.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse funktioner kan prefixes med ar eller arc #NEWLINE#i stedet for a.#NEWLINE#
|
||||
; Table of statements
|
||||
symstatement
|
||||
----------------------------------------------------------------------#NEWLINE#ryd Ryd konsol vindue.#NEWLINE#definer Definer funktion.#NEWLINE#slet Slet variabler og funktioner.#NEWLINE#cifre Angiv antal betydende cifre.#NEWLINE#beregn Beregn aritmetiske udtryk.#NEWLINE#k<>r Afvikel kommondoer i en fil.#NEWLINE#funktioner Vis liste med brugerdefinerede funktioner.#NEWLINE#ind Skift numerisk talsystem ved l<>sning (eksperimentelt).#NEWLINE#hj<68>lp Vis grundl<64>ggende hj<68>lpetekst.#NEWLINE#ud Skift numerisk talsystem ved skrivning (eksperimentelt).#NEWLINE#list Vis indholdet af en mappe.#NEWLINE#vis Vis indholdet af en fil.#NEWLINE#hent Hent variabler og funktioner fra en fil.#NEWLINE#gem Gem variabler og funktioner til en fil.#NEWLINE#variabler Vis variabler i hukommelsen.#NEWLINE#version Vis infomation om denne version.#NEWLINE#hukommelse Vis internt hukommelsesforbrug.#NEWLINE#afslut Afslut program.#NEWLINE#----------------------------------------------------------------------#NEWLINE#Det er valgfrit at angive definer og beregn kommandoerne. Kommandoerne#NEWLINE#funktioner og variabler kan forkortes til funk og var.#NEWLINE#
|
||||
symearly
|
||||
TODO-------------------------------------------------#NEWLINE#ver Versed sine function.#NEWLINE#vcs Versed cosine function.#NEWLINE#cvs Coversed sine function.#NEWLINE#cvc Coversed cosine function.#NEWLINE#hv Haversed sine function.#NEWLINE#hvc Haversed cosine function.#NEWLINE#hcv Hacoversed sine function.#NEWLINE#hcc Hacoversed cosine function.#NEWLINE#aver Inverse versed sine function.#NEWLINE#avcs Inverse versed cosine function.#NEWLINE#acvs Inverse coversed sine function.#NEWLINE#acvc Inverse coversed cosine function.#NEWLINE#ahv Inverse haversed sine function.#NEWLINE#ahvc Inverse haversed cosine function.#NEWLINE#ahcv Inverse hacoversed sine function.#NEWLINE#ahcc Inverse hacoversed cosine function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#
|
||||
symcomplex
|
||||
Udtryk med komplekse tal skrives ved at angive i#NEWLINE#sammen med den imagin<69>re talv<6C>rdi. Komplekse tal#NEWLINE#kan blandes med reelle tal.#NEWLINE##SYNTAXHIGHLIGHT#Syntaks: 2+3i#NEWLINE#Eksempel: 2+3.2i*cos(-1i)+5/7#NEWLINE#
|
||||
symclear
|
||||
|
@ -82,6 +81,10 @@ symsave
|
|||
Med gem kommando kan variabler og funktioner i hukommelsen gemmes til en fil.#NEWLINE#Gemte variabler og funktion kan indl<64>stet igen med #SYNTAXHIGHLIGHT#hent#NORMAL# kommandoen.#NEWLINE##SYNTAXHIGHLIGHT#Syntaks: gem "mitarbejde"#NEWLINE#
|
||||
symversion
|
||||
Viser hvilken version af amath der k<>rer.#NEWLINE#
|
||||
symabout
|
||||
TODOShow various information about the running version of amath.#NEWLINE#
|
||||
symlicense
|
||||
TODOShow license details.#NEWLINE#
|
||||
symmem
|
||||
Viser internt hukommelsesforbrug. Programkoden er ikke medregnet.#NEWLINE#
|
||||
; Help for prefs statement
|
||||
|
|
|
@ -10,72 +10,112 @@
|
|||
; ## Parts of the content came from wikipedia.org
|
||||
; #############################################################################
|
||||
abs
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sgn
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
round
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
trunc
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
floor
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
ceil
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sqr
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
cbr
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
lb
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
ln
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
lg
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sin
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
cos
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
tan
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
cot
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sec
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
csc
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
asin
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acos
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
atan
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acot
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
asec
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acsc
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sinh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
cosh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
tanh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
coth
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
sech
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
csch
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
asinh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acosh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
atanh
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acoth
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
asech
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<EFBFBD>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
acsch
|
||||
Der er ikke nogen hjælp tilgængelig om den funktion.#NEWLINE#
|
||||
Der er ikke nogen hj<68>lp tilg<6C>ngelig om den funktion.#NEWLINE#
|
||||
ver
|
||||
The versed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the cosine.#NEWLINE#ver(x) = 1 - cos(x)#NEWLINE#
|
||||
vcs
|
||||
The versed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the cosine.#NEWLINE#ver(x) = 1 + cos(x)#NEWLINE#
|
||||
cvs
|
||||
The coversed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the sine.#NEWLINE#ver(x) = 1 - sin(x)#NEWLINE#
|
||||
cvc
|
||||
The coversed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the sine.#NEWLINE#cvc(x) = 1 + sin(x)#NEWLINE#
|
||||
hv
|
||||
No help is available for the haversed sine function.#NEWLINE#
|
||||
hvc
|
||||
No help is available for the haversed cosine function.#NEWLINE#
|
||||
hcv
|
||||
No help is available for the hacoversed sine function.#NEWLINE#
|
||||
hcc
|
||||
No help is available for the hacoversed cosine function.#NEWLINE#
|
||||
aver
|
||||
No help is available for this function.#NEWLINE#
|
||||
avcs
|
||||
No help is available for this function.#NEWLINE#
|
||||
acvs
|
||||
No help is available for this function.#NEWLINE#
|
||||
acvc
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahv
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahvc
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahcv
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahcc
|
||||
No help is available for this function.#NEWLINE#
|
||||
exsec
|
||||
No help is available for this function.#NEWLINE#
|
||||
excsc
|
||||
No help is available for this function.#NEWLINE#
|
||||
aexsec
|
||||
No help is available for this function.#NEWLINE#
|
||||
aexcsc
|
||||
No help is available for this function.#NEWLINE#
|
|
@ -88,6 +88,9 @@ hyper
|
|||
hyper
|
||||
hyperbolic
|
||||
hyperbolsk
|
||||
;######### Early keyword
|
||||
early
|
||||
tidlig
|
||||
;######### HelpStatement
|
||||
help
|
||||
hj<EFBFBD>lp
|
||||
|
@ -153,3 +156,9 @@ hex
|
|||
hex
|
||||
hexadecimal
|
||||
hexadecimal
|
||||
;######### AboutStatement and keyword
|
||||
about
|
||||
om
|
||||
;######### LicenseStatement and keyword
|
||||
license
|
||||
lisens
|
|
@ -28,6 +28,46 @@
|
|||
; #############################################################################
|
||||
INTROMSG
|
||||
#NORMALTEXT##BOLD##STARTMSG##NEWLINE##NORMALTEXT##COLOR02#Skriv hj<68>lp for at f<> vist uddybende information.#NEWLINE#
|
||||
STATEMENTLINE
|
||||
---------------------------------------------------------#NEWLINE#
|
||||
STATEMENTCLEAR
|
||||
clear Clear console window.#NEWLINE#
|
||||
STATEMENTDEF
|
||||
def Define function.#NEWLINE#
|
||||
STATEMENTDELETE
|
||||
delete Delete variable or function.#NEWLINE#
|
||||
STATEMENTDIGITS
|
||||
digits Set number of significant digits.#NEWLINE#
|
||||
STATEMENTEVAL
|
||||
eval Evaluate arithmetic expression.#NEWLINE#
|
||||
STATEMENTEXECUTE
|
||||
execute Execute statements in a file.#NEWLINE#
|
||||
STATEMENTFUNCS
|
||||
functions Show list of user defined functions.#NEWLINE#
|
||||
STATEMENTINPUT
|
||||
input Change numeral input system.#NEWLINE#
|
||||
STATEMENTHELP
|
||||
help Show basic help text.#NEWLINE#
|
||||
STATEMENTOUTPUT
|
||||
output Change numeral output system.#NEWLINE#
|
||||
STATEMENTLIST
|
||||
list Show content of a directory.#NEWLINE#
|
||||
STATEMENTSHOW
|
||||
show Show content of a file.#NEWLINE#
|
||||
STATEMENTLOAD
|
||||
load Load variable and functions from file.#NEWLINE#
|
||||
STATEMENTSAVE
|
||||
save Save variable and functions to file.#NEWLINE#
|
||||
STATEMENTVARS
|
||||
variables Show list of variables.#NEWLINE#
|
||||
STATEMENTVERSION
|
||||
version Show version string.#NEWLINE#
|
||||
STATEMENTMEMORY
|
||||
memory Show internal memory usage.#NEWLINE#
|
||||
STATEMENTEXIT
|
||||
exit Exit program.#NEWLINE#
|
||||
STATEMENTFOOTER
|
||||
The def and eval statements are optional. Functions and#NEWLINE#variables statements can be shorten to funcs and vars.#NEWLINE#
|
||||
TXTLISTDIRHEADER
|
||||
Type Navn#NEWLINE#-----------------------------------------------#NEWLINE#
|
||||
TXTLISTDIRTFILE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## version $VER: amath-help.catalog 1.60 (08.04.2015) English
|
||||
## version $VER: amath-help.catalog 1.70 (28.02.2017) English
|
||||
## language english
|
||||
## codeset 0
|
||||
; #############################################################################
|
||||
|
@ -31,7 +31,7 @@
|
|||
; #############################################################################
|
||||
; Introduction table - Symbol(0)
|
||||
symzero
|
||||
Enter command or expression to evaluate.#NEWLINE##SYNTAXHIGHLIGHT#Example: 2+3-cos(3)#NORMALTEXT##NEWLINE# #NEWLINE#More help is available for designated topics.#NEWLINE#-------------------------------------------------#NEWLINE#functions Base functions.#NEWLINE#trigon Trigonometric functions.#NEWLINE#hyper Hyperbolic functions.#NEWLINE#complex Syntax for complex numbers.#NEWLINE#statements Available statements.#NEWLINE#operators Supported operators.#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: help trigon#NEWLINE#
|
||||
Enter command or expression to evaluate.#NEWLINE##SYNTAXHIGHLIGHT#Example: 2+3-cos(3)#NORMALTEXT##NEWLINE# #NEWLINE#More help is available for designated topics.#NEWLINE#-------------------------------------------------#NEWLINE#functions Base functions.#NEWLINE#trigon Trigonometric functions.#NEWLINE#hyper Hyperbolic functions.#NEWLINE#early Early trigonometric functions.#NEWLINE#complex Syntax for complex numbers.#NEWLINE#statements Available statements.#NEWLINE#operators Supported operators.#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: help trigon#NEWLINE#
|
||||
; Table of operators
|
||||
symoperator
|
||||
-------------------------------------------------#NEWLINE# + Mathematical addition.#NEWLINE# - Mathematical subtraction.#NEWLINE# * Mathematical multiplication.#NEWLINE# / Mathematical division.#NEWLINE# ^ Mathematical exponentiation.#NEWLINE# = Assignment of variable values.#NEWLINE# | Absolute value of number. #NEWLINE#-------------------------------------------------#NEWLINE#
|
||||
|
@ -40,13 +40,13 @@ symfunction
|
|||
-------------------------------------------------#NEWLINE#abs Absolute value of number.#NEWLINE#sgn Mathematical signum function.#NEWLINE#round Round to nearest integer number.#NEWLINE#trunc Discard fraction part of number.#NEWLINE#floor Mathematical floor function.#NEWLINE#ceil Mathematical ceiling function.#NEWLINE#sqrt Square root function (exp 1/2).#NEWLINE#cbrt Cube root function (exp 1/3).#NEWLINE#lb Binary logarithm function (base 2).#NEWLINE#ln Natural logarithm function (base e).#NEWLINE#lg Common logarithm function (base 10).#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: round(1.55)#NORMALTEXT##NEWLINE#
|
||||
; Table of trigonometric functions
|
||||
symtrigon
|
||||
-------------------------------------------------#NEWLINE#sin Trigonometric sine function.#NEWLINE#cos Trigonometric cosine function.#NEWLINE#tan Trigonometric tangent function.#NEWLINE#cot Trigonometric cotangent function.#NEWLINE#sec Trigonometric secant function.#NEWLINE#csc Trigonometric cosecant function.#NEWLINE#asin Inverse trigonometric sine function.#NEWLINE#acos Inverse trigonometric cosine function.#NEWLINE#atan Inverse trigonometric tangent function.#NEWLINE#acot Inverse trigonometric cotangent function.#NEWLINE#asec Inverse trigonometric secant function.#NEWLINE#acsc Inverse trigonometric cosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#
|
||||
-------------------------------------------------#NEWLINE#sin Trigonometric sine function.#NEWLINE#cos Trigonometric cosine function.#NEWLINE#tan Trigonometric tangent function.#NEWLINE#cot Trigonometric cotangent function.#NEWLINE#sec Trigonometric secant function.#NEWLINE#csc Trigonometric cosecant function.#NEWLINE#exsec Trigonometric exsecant function.#NEWLINE#excsc Trigonometric excosecant function.#NEWLINE#asin Inverse trigonometric sine function.#NEWLINE#acos Inverse trigonometric cosine function.#NEWLINE#atan Inverse trigonometric tangent function.#NEWLINE#acot Inverse trigonometric cotangent function.#NEWLINE#asec Inverse trigonometric secant function.#NEWLINE#acsc Inverse trigonometric cosecant function.#NEWLINE#exsec Inverse trigonometric exsecant function.#NEWLINE#excsc Inverse trigonometric excosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#
|
||||
; Table of hyperbolic functions
|
||||
symhyper
|
||||
-------------------------------------------------#NEWLINE#sinh Hyperbolic sine function.#NEWLINE#cosh Hyperbolic cosine function.#NEWLINE#tanh Hyperbolic tangent function.#NEWLINE#coth Hyperbolic cotangent function.#NEWLINE#sech Hyperbolic secant function.#NEWLINE#csch Hyperbolic cosecant function. #NEWLINE#asinh Inverse hyperbolic sine function.#NEWLINE#acosh Inverse hyperbolic cosine function.#NEWLINE#atanh Inverse hyperbolic tangent function.#NEWLINE#acoth Inverse hyperbolic cotangent function.#NEWLINE#asech Inverse hyperbolic secant function.#NEWLINE#acsch Inverse hyperbolic cosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#
|
||||
; Table of statements
|
||||
symstatement
|
||||
---------------------------------------------------------#NEWLINE#clear Clear console window.#NEWLINE#def Define function.#NEWLINE#delete Delete variable or function.#NEWLINE#digits Set number of significant digits.#NEWLINE#eval Evaluate arithmetic expression.#NEWLINE#execute Execute statements in a file.#NEWLINE#functions Show list of user defined functions.#NEWLINE#input Change numeral input system.#NEWLINE#help Show basic help text.#NEWLINE#output Change numeral output system.#NEWLINE#list Show content of a directory.#NEWLINE#show Show content of a file.#NEWLINE#load Load variable and functions from file.#NEWLINE#save Save variable and functions to file.#NEWLINE#variables Show list of variables.#NEWLINE#version Show version string.#NEWLINE#memory Show internal memory usage.#NEWLINE#exit Exit program.#NEWLINE#---------------------------------------------------------#NEWLINE#The def and eval statements are optional. Functions and#NEWLINE#variables statements can be shorten to funcs and vars.#NEWLINE#
|
||||
; Table of early trigonometric functions
|
||||
symearly
|
||||
-------------------------------------------------#NEWLINE#ver Versed sine function.#NEWLINE#vcs Versed cosine function.#NEWLINE#cvs Coversed sine function.#NEWLINE#cvc Coversed cosine function.#NEWLINE#hv Haversed sine function.#NEWLINE#hvc Haversed cosine function.#NEWLINE#hcv Hacoversed sine function.#NEWLINE#hcc Hacoversed cosine function.#NEWLINE#aver Inverse versed sine function.#NEWLINE#avcs Inverse versed cosine function.#NEWLINE#acvs Inverse coversed sine function.#NEWLINE#acvc Inverse coversed cosine function.#NEWLINE#ahv Inverse haversed sine function.#NEWLINE#ahvc Inverse haversed cosine function.#NEWLINE#ahcv Inverse hacoversed sine function.#NEWLINE#ahcc Inverse hacoversed cosine function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#
|
||||
; Help for complex numbers
|
||||
symcomplex
|
||||
Expressions with complex numbers are written using an i to denote#NEWLINE#the imaginary value. Complex numbers can seamlessly be mixed with#NEWLINE#real numbers.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: 2+3i#NEWLINE#Example: 2+3.2i*cos(-1i)+5/7#NEWLINE#
|
||||
|
@ -92,6 +92,12 @@ The save statement saves defined variables and functions to a file in a#NEWLINE#
|
|||
; Help for version statement
|
||||
symversion
|
||||
Show which version of amath is running.#NEWLINE#
|
||||
; Help for about statement
|
||||
symabout
|
||||
Show various information about the running version of amath.#NEWLINE#
|
||||
; Help for license statement
|
||||
symlicense
|
||||
Show license details.#NEWLINE#
|
||||
; Help for memory statement
|
||||
symmem
|
||||
Show internal memory usage together with maximum usage.#NEWLINE#
|
||||
|
@ -127,4 +133,4 @@ symdec
|
|||
No help is available for the decimal keyword#NEWLINE
|
||||
; Help for hexadecimal keyword
|
||||
symhex
|
||||
No help is available for the hexadecimal keyword#NEWLINE
|
||||
No help is available for the hexadecimal keyword#NEWLINE
|
|
@ -1,4 +1,4 @@
|
|||
## version $VER: amath-ident.catalog 1.60 (08.04.2015) English
|
||||
## version $VER: amath-ident.catalog 1.70 (28.02.2017) English
|
||||
## language english
|
||||
## codeset 0
|
||||
;#############################################################################
|
||||
|
@ -87,3 +87,43 @@ asech
|
|||
No help is available for this function.#NEWLINE#
|
||||
acsch
|
||||
No help is available for this function.#NEWLINE#
|
||||
ver
|
||||
The versed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the cosine.#NEWLINE#ver(x) = 1 - cos(x)#NEWLINE#
|
||||
vcs
|
||||
The versed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the cosine.#NEWLINE#ver(x) = 1 + cos(x)#NEWLINE#
|
||||
cvs
|
||||
The coversed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the sine.#NEWLINE#ver(x) = 1 - sin(x)#NEWLINE#
|
||||
cvc
|
||||
The coversed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the sine.#NEWLINE#cvc(x) = 1 + sin(x)#NEWLINE#
|
||||
hv
|
||||
No help is available for the haversed sine function.#NEWLINE#
|
||||
hvc
|
||||
No help is available for the haversed cosine function.#NEWLINE#
|
||||
hcv
|
||||
No help is available for the hacoversed sine function.#NEWLINE#
|
||||
hcc
|
||||
No help is available for the hacoversed cosine function.#NEWLINE#
|
||||
aver
|
||||
No help is available for this function.#NEWLINE#
|
||||
avcs
|
||||
No help is available for this function.#NEWLINE#
|
||||
acvs
|
||||
No help is available for this function.#NEWLINE#
|
||||
acvc
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahv
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahvc
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahcv
|
||||
No help is available for this function.#NEWLINE#
|
||||
ahcc
|
||||
No help is available for this function.#NEWLINE#
|
||||
exsec
|
||||
No help is available for this function.#NEWLINE#
|
||||
excsc
|
||||
No help is available for this function.#NEWLINE#
|
||||
aexsec
|
||||
No help is available for this function.#NEWLINE#
|
||||
aexcsc
|
||||
No help is available for this function.#NEWLINE#
|
|
@ -1,4 +1,4 @@
|
|||
## version $VER: amath-text.catalog 1.60 (08.04.2015) English
|
||||
## version $VER: amath-text.catalog 1.70 (28.02.2017) English
|
||||
## language english
|
||||
## codeset 0
|
||||
; #############################################################################
|
||||
|
@ -31,6 +31,46 @@
|
|||
; #############################################################################
|
||||
INTROMSG
|
||||
#NORMALTEXT##BOLD##STARTMSG##NEWLINE##NORMALTEXT##COLOR02#Type help to show info.#NEWLINE#
|
||||
STATEMENTLINE
|
||||
---------------------------------------------------------#NEWLINE#
|
||||
STATEMENTCLEAR
|
||||
clear Clear console window.#NEWLINE#
|
||||
STATEMENTDEF
|
||||
def Define function.#NEWLINE#
|
||||
STATEMENTDELETE
|
||||
delete Delete variable or function.#NEWLINE#
|
||||
STATEMENTDIGITS
|
||||
digits Set number of significant digits.#NEWLINE#
|
||||
STATEMENTEVAL
|
||||
eval Evaluate arithmetic expression.#NEWLINE#
|
||||
STATEMENTEXECUTE
|
||||
execute Execute statements in a file.#NEWLINE#
|
||||
STATEMENTFUNCS
|
||||
functions Show list of user defined functions.#NEWLINE#
|
||||
STATEMENTINPUT
|
||||
input Change numeral input system.#NEWLINE#
|
||||
STATEMENTHELP
|
||||
help Show basic help text.#NEWLINE#
|
||||
STATEMENTOUTPUT
|
||||
output Change numeral output system.#NEWLINE#
|
||||
STATEMENTLIST
|
||||
list Show content of a directory.#NEWLINE#
|
||||
STATEMENTSHOW
|
||||
show Show content of a file.#NEWLINE#
|
||||
STATEMENTLOAD
|
||||
load Load variable and functions from file.#NEWLINE#
|
||||
STATEMENTSAVE
|
||||
save Save variable and functions to file.#NEWLINE#
|
||||
STATEMENTVARS
|
||||
variables Show list of variables.#NEWLINE#
|
||||
STATEMENTVERSION
|
||||
version Show version string.#NEWLINE#
|
||||
STATEMENTMEMORY
|
||||
memory Show internal memory usage.#NEWLINE#
|
||||
STATEMENTEXIT
|
||||
exit Exit program.#NEWLINE#
|
||||
STATEMENTFOOTER
|
||||
The def and eval statements are optional. Functions and#NEWLINE#variables statements can be shorten to funcs and vars.#NEWLINE#
|
||||
TXTLISTDIRHEADER
|
||||
Type Name#NEWLINE#-----------------------------------------------#NEWLINE#
|
||||
TXTLISTDIRTFILE
|
||||
|
@ -60,7 +100,7 @@ Function cannot be redefined:#SPACE#
|
|||
HELPPNUMERA
|
||||
Base value must be between 2 and 32:#SPACE#
|
||||
HELPPDIGITS
|
||||
Number of digits must be between 0 and 15:#SPACE#
|
||||
Number of digist must be between 0 and 15:#SPACE#
|
||||
HELPINPUSHOW
|
||||
Numeral input system is#SPACE#
|
||||
HELPOUTPSHOW
|
||||
|
@ -96,4 +136,4 @@ Preferences could not be saved.#NEWLINE#
|
|||
MSGNODIR
|
||||
Could not open directory:#SPACE#
|
||||
MSGNOFILE
|
||||
Cannot open file.#NEWLINE#
|
||||
Cannot open file.#NEWLINE#
|
|
@ -27,75 +27,94 @@
|
|||
|
||||
set -e
|
||||
|
||||
version="1.7.0"
|
||||
|
||||
clang=false
|
||||
debugsym=false
|
||||
regtest=true
|
||||
|
||||
prefix="/usr"
|
||||
pkgconfigdir="lib/pkgconfig"
|
||||
cflags=""
|
||||
cxxflags=""
|
||||
ldflags=""
|
||||
gcclib="-lstdc++"
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--prefix=*)
|
||||
prefix=`echo $arg | sed 's/--prefix=//'`
|
||||
;;
|
||||
case "$arg" in
|
||||
--prefix=*)
|
||||
prefix=`echo $arg | sed 's/--prefix=//'`
|
||||
;;
|
||||
|
||||
--cross-compile=*)
|
||||
crosscompile=`echo $arg | sed 's/--cross-compile=//'`
|
||||
--pkgconfig=*)
|
||||
pkgconfigdir=`echo $arg | sed 's/--pkgconfig=//'`
|
||||
;;
|
||||
|
||||
--cross-compile=*)
|
||||
crosscompile=`echo $arg | sed 's/--cross-compile=//'`
|
||||
crosscompile="${crosscompile}-"
|
||||
;;
|
||||
;;
|
||||
|
||||
--cflags=*)
|
||||
cflags=`echo $arg | sed 's/--cflags=//'`
|
||||
CFLAGS=*)
|
||||
cflags=`echo $arg | sed 's/CFLAGS=//'`
|
||||
cflags="${cflags} "
|
||||
;;
|
||||
;;
|
||||
|
||||
--cxxflags=*)
|
||||
cxxflags=`echo $arg | sed 's/--cxxflags=//'`
|
||||
CXXFLAGS=*)
|
||||
cxxflags=`echo $arg | sed 's/CXXFLAGS=//'`
|
||||
cxxflags="${cxxflags} "
|
||||
;;
|
||||
;;
|
||||
|
||||
--ldflags=*)
|
||||
ldflags=`echo $arg | sed 's/--ldflags=//'`
|
||||
LDFLAGS=*)
|
||||
ldflags=`echo $arg | sed 's/LDFLAGS=//'`
|
||||
ldflags="${ldflags} "
|
||||
;;
|
||||
|
||||
;;
|
||||
|
||||
--enable-clang)
|
||||
clang=true;;
|
||||
--disable-clang)
|
||||
clang=false;;
|
||||
clang=true;;
|
||||
--disable-clang)
|
||||
clang=false;;
|
||||
|
||||
--enable-debug)
|
||||
debugsym=true;;
|
||||
--disable-debug)
|
||||
debugsym=false;;
|
||||
--enable-debug)
|
||||
debugsym=true;;
|
||||
--disable-debug)
|
||||
debugsym=false;;
|
||||
|
||||
--enable-test)
|
||||
regtest=true;;
|
||||
--disable-test)
|
||||
regtest=false;;
|
||||
--enable-test)
|
||||
regtest=true;;
|
||||
--disable-test)
|
||||
regtest=false;;
|
||||
|
||||
--help)
|
||||
echo 'usage: ./configure [options]'
|
||||
echo 'options:'
|
||||
echo ' --prefix=<path>: installation prefix'
|
||||
echo ' --cflag=<flags>: additional compiler flags'
|
||||
echo ' --cxxflag=<flags>: additional compiler flags'
|
||||
echo ' --ldflag=<flags>: additional linker flags'
|
||||
echo ' --cross-compile=<prefix>: cross compiler prefix'
|
||||
echo ' --enable-debug: include debug symbols'
|
||||
echo ' --disable-debug: do not include debug symbols'
|
||||
echo ' --enable-test: build code with regression tests'
|
||||
echo ' --disable-test: do not include regression test'
|
||||
echo ' --enable-clang: build with clang compiler'
|
||||
echo ' --disable-clang: do not build with clang compiler'
|
||||
echo 'all invalid options are silently ignored'
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
--enable-stdc++)
|
||||
gcclib="-lstdc++";;
|
||||
--disable-stdc++)
|
||||
gcclib="";;
|
||||
|
||||
--help)
|
||||
echo "amath configure script ${version}"
|
||||
echo
|
||||
echo 'usage: ./configure [options]'
|
||||
echo 'options:'
|
||||
echo ' --prefix=<path>: installation prefix'
|
||||
echo ' --pkgconfig=<path>: pkg-config path (without prefix)'
|
||||
echo ' --cross-compile=<prefix>: cross compiler prefix'
|
||||
echo ' --enable-debug: include debug symbols'
|
||||
echo ' --disable-debug: do not include debug symbols'
|
||||
echo ' --enable-test: build code with regression tests'
|
||||
echo ' --disable-test: do not include regression test'
|
||||
echo ' --enable-clang: build with clang compiler'
|
||||
echo ' --disable-clang: do not build with clang compiler'
|
||||
echo ' --enable-stdc++: link with stdc++ library'
|
||||
echo ' --disable-stdc++: do not link with stdc++ library'
|
||||
echo
|
||||
echo ' CFLAGS=<flags>: additional compiler flags'
|
||||
echo ' CXXFLAGS=<flags>: additional compiler flags'
|
||||
echo ' LDFLAGS=<flags>: additional linker flags'
|
||||
echo
|
||||
echo 'all invalid options are silently ignored'
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if $clang; then
|
||||
|
@ -127,7 +146,6 @@ cxxflags="${cflags} ${cxxflags}"
|
|||
APPSRCS='
|
||||
evaluator.cpp
|
||||
functionlist.cpp
|
||||
functions.cpp
|
||||
fgrid.cpp
|
||||
lexer.cpp
|
||||
nodes.cpp
|
||||
|
@ -145,9 +163,6 @@ console_amiga.cpp
|
|||
console_stdc.cpp
|
||||
filesystem_amiga.cpp
|
||||
filesystem_stdc.cpp
|
||||
graph.cpp
|
||||
graph_amiga.cpp
|
||||
graph_gtk.cpp
|
||||
language.cpp
|
||||
language_amiga.cpp
|
||||
language_posix.cpp
|
||||
|
@ -174,6 +189,14 @@ arctan.cpp
|
|||
arccosecant.cpp
|
||||
arccotangent.cpp
|
||||
arcsecant.cpp
|
||||
arccovercosine.cpp
|
||||
arccoversine.cpp
|
||||
archacovercosine.cpp
|
||||
archacoversine.cpp
|
||||
archavercosine.cpp
|
||||
archaversine.cpp
|
||||
arcvercosine.cpp
|
||||
arcversine.cpp
|
||||
ceil.cpp
|
||||
cosecant.cpp
|
||||
cosine.cpp
|
||||
|
@ -188,6 +211,18 @@ hacovercos.cpp
|
|||
hacoversin.cpp
|
||||
havercos.cpp
|
||||
haversin.cpp
|
||||
hyparccosecant.cpp
|
||||
hyparccosine.cpp
|
||||
hyparccotangent.cpp
|
||||
hyparcsecant.cpp
|
||||
hyparcsine.cpp
|
||||
hyparctangent.cpp
|
||||
hypcosecant.cpp
|
||||
hypcosine.cpp
|
||||
hypcotangent.cpp
|
||||
hypsecant.cpp
|
||||
hypsine.cpp
|
||||
hyptangent.cpp
|
||||
ln.cpp
|
||||
log10.cpp
|
||||
log2.cpp
|
||||
|
@ -327,6 +362,25 @@ strcmp.c
|
|||
strlen.c
|
||||
untag.c
|
||||
'
|
||||
FLXSRCS='
|
||||
asprintf.c
|
||||
createcat.c
|
||||
createcatsrc.c
|
||||
createct.c
|
||||
globals.c
|
||||
locale_other.c
|
||||
main.c
|
||||
openlibs.c
|
||||
readprefs.c
|
||||
scancd.c
|
||||
scanct.c
|
||||
scanpo.c
|
||||
showfuncs.c
|
||||
strptime.c
|
||||
swapfuncs.c
|
||||
utils.c
|
||||
vastubs.c
|
||||
'
|
||||
|
||||
amathc="amathc"
|
||||
amath="amath"
|
||||
|
@ -469,17 +523,21 @@ echo
|
|||
|
||||
########################## Application Library ##########################
|
||||
{
|
||||
echo "CXX = ${crosscompile}${cxxcompiler}"
|
||||
echo "CXXFLAGS = ${libop}${options} ${cxxflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo
|
||||
echo "alib = lib${amathapp}.a"
|
||||
echo "solib = lib${amathapp}.so"
|
||||
echo "CXX = ${crosscompile}${cxxcompiler}"
|
||||
echo "CXXFLAGS = ${libop}${options} ${cxxflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "LDCONFIG = ldconfig"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
|
||||
echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
|
||||
echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
|
||||
echo "alib = lib${amathapp}.a"
|
||||
echo "solib = lib${amathapp}.so"
|
||||
echo "pkgconfig = amatha.pc"
|
||||
echo
|
||||
echo "all: static shared"
|
||||
echo
|
||||
|
@ -509,20 +567,44 @@ echo " \${MKDIR} static"
|
|||
echo " \${MKDIR} shared"
|
||||
echo
|
||||
echo "\${solib}: build ${files2}"
|
||||
echo " \${CC} -shared -fPIC -Wl,-soname,\${solib} -o \${solib} ${files2}"
|
||||
echo " \${CXX} \${CXXFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}.${version} -o \${solib} ${files2}"
|
||||
echo
|
||||
echo "\${alib}: build ${files}"
|
||||
echo " \${AR} rcs static/\${alib} ${files}"
|
||||
echo " \${RANLIB} static/\${alib}"
|
||||
echo
|
||||
echo ".PHONY: install"
|
||||
echo "install: \${solib}"
|
||||
echo " \${MKDIR} \${DESTDIR}\${PREFIX}/lib"
|
||||
echo " \${INSTALL} \${solib} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo ".PHONY: install"
|
||||
echo "install: \${alib} \${solib}"
|
||||
echo " \${MKDIR} \${INSTDIR}"
|
||||
echo " \${MKDIR} \${INSTDIRPC}"
|
||||
echo " \${MKDIR} \${INSTDIRI}"
|
||||
echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
|
||||
echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${INSTALL} aengine.h \${INSTDIRI}/aengine.h"
|
||||
echo " \${INSTALL} charbuf.h \${INSTDIRI}/charbuf.h"
|
||||
echo " \${INSTALL} cplex.h \${INSTDIRI}/cplex.h"
|
||||
echo " \${INSTALL} integer.h \${INSTDIRI}/integer.h"
|
||||
echo " \${INSTALL} nnumb.h \${INSTDIRI}/nnumb.h"
|
||||
echo " \${INSTALL} ntext.h \${INSTDIRI}/ntext.h"
|
||||
echo " \${INSTALL} numb.h \${INSTDIRI}/numb.h"
|
||||
echo " \${INSTALL} real.h \${INSTDIRI}/real.h"
|
||||
echo " \${LDCONFIG} \${INSTDIR}"
|
||||
echo
|
||||
echo ".PHONY: uninstall"
|
||||
echo "uninstall:"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${alib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${solib}"
|
||||
echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${DEL} \${INSTDIRI}/aengine.h"
|
||||
echo " \${DEL} \${INSTDIRI}/charbuf.h"
|
||||
echo " \${DEL} \${INSTDIRI}/cplex.h"
|
||||
echo " \${DEL} \${INSTDIRI}/integer.h"
|
||||
echo " \${DEL} \${INSTDIRI}/nnumb.h"
|
||||
echo " \${DEL} \${INSTDIRI}/ntext.h"
|
||||
echo " \${DEL} \${INSTDIRI}/numb.h"
|
||||
echo " \${DEL} \${INSTDIRI}/real.h"
|
||||
echo " \${LDCONFIG}"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " \${DEL} static/\${alib} \${solib} ${files} ${files2}"
|
||||
|
@ -532,17 +614,23 @@ echo
|
|||
|
||||
############################### C Library ###############################
|
||||
{
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo
|
||||
echo "alib = lib${amathc}.a"
|
||||
echo "solib = lib${amathc}.so"
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "LDCONFIG = ldconfig"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
|
||||
echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
|
||||
echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
|
||||
echo "INSTDIRM = \${DESTDIR}\${PREFIX}/share/man/man3"
|
||||
echo "alib = lib${amathc}.a"
|
||||
echo "solib = lib${amathc}.so"
|
||||
echo "pkgconfig = amathc.pc"
|
||||
echo "manpage = amathc.3"
|
||||
echo
|
||||
echo "all: static shared"
|
||||
echo
|
||||
|
@ -572,7 +660,7 @@ echo " \${MKDIR} static"
|
|||
echo " \${MKDIR} shared"
|
||||
echo
|
||||
echo "\${solib}: build ${libcs}"
|
||||
echo " \${CC} -shared -fPIC -Wl,-soname,\${solib} -o \${solib} ${libcs} -lc"
|
||||
echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}.${version} -o \${solib} ${libcs} -lc"
|
||||
echo
|
||||
echo "\${alib}: build ${libc}"
|
||||
echo " \${AR} rcs static/\${alib} ${libc}"
|
||||
|
@ -580,19 +668,26 @@ echo " \${RANLIB} static/\${alib}"
|
|||
echo
|
||||
echo ".PHONY: install"
|
||||
echo "install: \${alib} \${solib}"
|
||||
echo " \${MKDIR} \${DESTDIR}\${PREFIX}/lib"
|
||||
echo " \${MKDIR} \${DESTDIR}\${PREFIX}/include"
|
||||
echo " \${INSTALL} static/\${alib} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${INSTALL} ../amath.h \${DESTDIR}\${PREFIX}/include"
|
||||
echo " \${INSTALL} ../amathc.h \${DESTDIR}\${PREFIX}/include"
|
||||
echo " \${MKDIR} \${INSTDIR}"
|
||||
echo " \${MKDIR} \${INSTDIRPC}"
|
||||
echo " \${MKDIR} \${INSTDIRI}"
|
||||
echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
|
||||
echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${INSTALL} ../amath.h \${INSTDIRI}"
|
||||
echo " \${INSTALL} ../amathc.h \${INSTDIRI}"
|
||||
echo " \${LDCONFIG} \${INSTDIR}"
|
||||
echo
|
||||
echo ".PHONY: uninstall"
|
||||
echo "uninstall:"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/include/amath.h"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/include/amathc.h"
|
||||
echo " \${DEL} \${INSTDIR}/\${alib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${solib}"
|
||||
echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${DEL} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${DEL} \${INSTDIRI}/amath.h"
|
||||
echo " \${DEL} \${INSTDIRI}/amathc.h"
|
||||
echo " \${LDCONFIG}"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " \${DEL} static/\${alib} \${solib} ${libc} ${libcs}"
|
||||
|
@ -603,17 +698,23 @@ echo
|
|||
|
||||
############################# Real Numbers ##############################
|
||||
{
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo
|
||||
echo "alib = lib${amath}.a"
|
||||
echo "solib = lib${amath}.so"
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "LDCONFIG = ldconfig"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
|
||||
echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
|
||||
echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
|
||||
echo "INSTDIRM = \${DESTDIR}\${PREFIX}/share/man/man3"
|
||||
echo "alib = lib${amath}.a"
|
||||
echo "solib = lib${amath}.so"
|
||||
echo "pkgconfig = amathr.pc"
|
||||
echo "manpage = amathr.3"
|
||||
echo
|
||||
echo "all: static shared"
|
||||
echo
|
||||
|
@ -643,7 +744,7 @@ echo " \${MKDIR} static"
|
|||
echo " \${MKDIR} shared"
|
||||
echo
|
||||
echo "\${solib}: build ${libamaths}"
|
||||
echo " \${CC} -shared -fPIC -Wl,-soname,\${solib} -o \${solib} ${libamaths}"
|
||||
echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}.${version} -o \${solib} ${libamaths}"
|
||||
echo
|
||||
echo "\${alib}: build ${libamath}"
|
||||
echo " \${AR} rcs static/\${alib} ${libamath}"
|
||||
|
@ -651,14 +752,24 @@ echo " \${RANLIB} static/\${alib}"
|
|||
echo
|
||||
echo ".PHONY: install"
|
||||
echo "install: \${alib} \${solib}"
|
||||
echo " \${MKDIR} \${DESTDIR}\${PREFIX}/lib"
|
||||
echo " \${INSTALL} static/\${alib} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${MKDIR} \${INSTDIR}"
|
||||
echo " \${MKDIR} \${INSTDIRPC}"
|
||||
echo " \${MKDIR} \${INSTDIRI}"
|
||||
echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
|
||||
echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${INSTALL} ../math.h \${INSTDIRI}/amathr.h"
|
||||
echo " \${LDCONFIG} \${INSTDIR}"
|
||||
echo
|
||||
echo ".PHONY: uninstall"
|
||||
echo "uninstall:"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${alib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${solib}"
|
||||
echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${DEL} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${DEL} \${INSTDIRI}/amathr.h"
|
||||
echo " \${LDCONFIG}"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " \${DEL} static/\${alib} \${solib} ${libamath} ${libamaths}"
|
||||
|
@ -668,17 +779,23 @@ echo
|
|||
|
||||
############################ Complex Numbers ############################
|
||||
{
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cxxflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo
|
||||
echo "alib = lib${amathcplex}.a"
|
||||
echo "solib = lib${amathcplex}.so"
|
||||
echo "CC = ${crosscompile}${ccompiler}"
|
||||
echo "CFLAGS = -std=c9x ${libop}${options} ${cxxflags}-I. -I.. -Wall"
|
||||
echo "AR = ${crosscompile}ar"
|
||||
echo "RANLIB = ${crosscompile}ranlib"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0644"
|
||||
echo "LDCONFIG = ldconfig"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
|
||||
echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
|
||||
echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
|
||||
echo "INSTDIRM = \${DESTDIR}\${PREFIX}/share/man/man3"
|
||||
echo "alib = lib${amathcplex}.a"
|
||||
echo "solib = lib${amathcplex}.so"
|
||||
echo "pkgconfig = amathi.pc"
|
||||
echo "manpage = amathi.3"
|
||||
echo
|
||||
echo "all: static shared"
|
||||
echo
|
||||
|
@ -708,7 +825,7 @@ echo " \${MKDIR} static"
|
|||
echo " \${MKDIR} shared"
|
||||
echo
|
||||
echo "\${solib}: build ${libcomplexs}"
|
||||
echo " \${CC} -shared -fPIC -Wl,-soname,\${solib} -o \${solib} ${libcomplexs}"
|
||||
echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}.${version} -o \${solib} ${libcomplexs}"
|
||||
echo
|
||||
echo "\${alib}: build ${libcomplex}"
|
||||
echo " \${AR} rcs static/\${alib} ${libcomplex}"
|
||||
|
@ -716,16 +833,25 @@ echo " \${RANLIB} static/\${alib}"
|
|||
echo
|
||||
echo ".PHONY: install"
|
||||
echo "install: \${alib} \${solib}"
|
||||
echo " \${MKDIR} \${DESTDIR}\${PREFIX}/lib"
|
||||
echo " \${INSTALL} static/\${alib} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${INSTALL} ../complex.h \${DESTDIR}\${PREFIX}/include"
|
||||
echo " \${MKDIR} \${INSTDIR}"
|
||||
echo " \${MKDIR} \${INSTDIRPC}"
|
||||
echo " \${MKDIR} \${INSTDIRI}"
|
||||
echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
|
||||
echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
|
||||
echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${INSTALL} ../complex.h \${INSTDIRI}/amathi.h"
|
||||
echo " \${LDCONFIG} \${INSTDIR}"
|
||||
echo
|
||||
echo ".PHONY: uninstall"
|
||||
echo "uninstall:"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${alib}"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/lib/\${solib}"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/include/complex.h"
|
||||
echo " \${DEL} \${INSTDIR}/\${alib}"
|
||||
echo " \${DEL} \${INSTDIR}/\${solib}"
|
||||
echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
|
||||
echo " \${DEL} \${INSTDIRM}/\${manpage}"
|
||||
echo " \${DEL} \${INSTDIRPC}/amathi.pc"
|
||||
echo " \${DEL} \${INSTDIRI}/amathi.h"
|
||||
echo " \${LDCONFIG}"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " \${DEL} static/\${alib} \${solib} ${libcomplex} ${libcomplexs}"
|
||||
|
@ -748,8 +874,11 @@ echo "LPATHS = -Lsrc/lib/static -Lsrc/clib/static -Lsrc/real/static -Lsrc/cple
|
|||
echo "FLXCAT = build/flexcat/flexcat"
|
||||
echo "MKDIR = mkdir -p"
|
||||
echo "DEL = rm -f"
|
||||
echo "INSTALL = install -m 0755"
|
||||
echo "INSTALLP = install -m 0755"
|
||||
echo "INSTALLM = install -m 0644"
|
||||
echo "PREFIX = ${prefix}"
|
||||
echo "INSTDIRP = \${DESTDIR}\${PREFIX}/bin"
|
||||
echo "INSTDIRM = \${DESTDIR}\${PREFIX}/share/man/man1"
|
||||
echo
|
||||
echo "all: shared-app"
|
||||
echo "app: ${appmain} ${appfunction} ${appstatement} ${appsystem}"
|
||||
|
@ -785,25 +914,15 @@ echo
|
|||
echo "${amathcplex}:"
|
||||
echo " cd src/cplex && \${MAKE}"
|
||||
echo
|
||||
echo "catalogsa:" # Application catalogs
|
||||
echo "localize:"
|
||||
echo " cd build/flexcat && \${MAKE}"
|
||||
echo " \${FLXCAT} text/keyword.cd src/localize/kword.h=text/keyword.sd"
|
||||
echo " \${FLXCAT} text/help.cd src/localize/help.h=text/help.sd"
|
||||
echo " \${FLXCAT} text/ident.cd src/localize/ident.h=text/ident.sd"
|
||||
echo " \${FLXCAT} text/text.cd src/localize/text.h=text/text.sd"
|
||||
echo
|
||||
echo "catalogsu:" # Unix catalogs
|
||||
echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-help.ct >utext/dk-help.dict"
|
||||
echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-ident.ct >utext/dk-ident.dict"
|
||||
echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-text.ct >utext/dk-text.dict"
|
||||
echo " iconv -f ISO-8859-15 -t UTF-8 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict"
|
||||
echo
|
||||
echo "catalogsw:" # Windows catalogs
|
||||
echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-help.ct >utext/dk-help.dict"
|
||||
echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-ident.ct >utext/dk-ident.dict"
|
||||
echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-text.ct >utext/dk-text.dict"
|
||||
echo " iconv -f ISO-8859-15 -t CP850 catalog/dansk/amath-keyword.ct >utext/dk-keyword.dict"
|
||||
echo
|
||||
echo "amigacatalogs:"
|
||||
echo "catalogs:"
|
||||
echo " cd build/flexcat && \${MAKE}"
|
||||
echo " \${MKDIR} dist/catalog/english"
|
||||
echo " \${FLXCAT} text/help.cd catalog/english/amath-help.ct CATALOG dist/catalog/english/amath-help.catalog"
|
||||
echo " \${FLXCAT} text/ident.cd catalog/english/amath-ident.ct CATALOG dist/catalog/english/amath-ident.catalog"
|
||||
|
@ -829,16 +948,18 @@ echo " cd src/main/statement && \${MAKE} static"
|
|||
echo " \${CC} \${CFLAGS} ${exestrip} ${program}.o -o amath \${LPATHS} \${LFLAGS}"
|
||||
echo
|
||||
echo ".PHONY: test"
|
||||
echo "test: static-app"
|
||||
echo "test: amath"
|
||||
echo " LD_LIBRARY_PATH=src/clib/:src/lib:src/cplex:scr/real"
|
||||
echo " ./amath test"
|
||||
echo
|
||||
echo ".PHONY: install"
|
||||
echo "install: amath"
|
||||
echo "install: shared-app"
|
||||
echo " cd src/lib && \${MAKE} install"
|
||||
echo " cd src/clib && \${MAKE} install"
|
||||
echo " cd src/real && \${MAKE} install"
|
||||
echo " cd src/cplex && \${MAKE} install"
|
||||
echo " \${INSTALL} amath \${DESTDIR}\${PREFIX}/bin"
|
||||
echo " \${INSTALLP} amath \${INSTDIRP}/amath"
|
||||
echo " \${INSTALLM} amath.1 \${INSTDIRM}/amath.1"
|
||||
echo
|
||||
echo ".PHONY: uninstall"
|
||||
echo "uninstall:"
|
||||
|
@ -846,8 +967,10 @@ echo " cd src/lib && \${MAKE} uninstall"
|
|||
echo " cd src/clib && \${MAKE} uninstall"
|
||||
echo " cd src/real && \${MAKE} uninstall"
|
||||
echo " cd src/cplex && \${MAKE} uninstall"
|
||||
echo " \${DEL} \${DESTDIR}\${PREFIX}/bin/amath"
|
||||
echo " \${DEL} \${INSTDIRP}/amath"
|
||||
echo " \${DEL} \${INSTDIRM}/amath.1"
|
||||
echo
|
||||
echo ".PHONY: clean"
|
||||
echo "clean:"
|
||||
echo " cd src/lib && \${MAKE} clean"
|
||||
echo " cd src/clib && \${MAKE} clean"
|
||||
|
@ -857,8 +980,37 @@ echo " cd src/main && \${MAKE} clean"
|
|||
echo " cd src/system && \${MAKE} clean"
|
||||
echo " cd src/main/function && \${MAKE} clean"
|
||||
echo " cd src/main/statement && \${MAKE} clean"
|
||||
echo " cd build/flexcat && \${MAKE} clean"
|
||||
echo " \${DEL} ${program}.o amath"
|
||||
echo
|
||||
} > Makefile
|
||||
#########################################################################
|
||||
|
||||
################################ Flexcat ################################
|
||||
{
|
||||
echo 'all: flexcat'
|
||||
echo ''
|
||||
echo "CFLAGS += -I. -Wall"
|
||||
echo ''
|
||||
|
||||
l=""
|
||||
for f in ${FLXSRCS}
|
||||
do
|
||||
b=`basename $f .c`
|
||||
echo "${b}.o: ${f}"
|
||||
echo " \${CC} \${CFLAGS} -c ${f}"
|
||||
echo
|
||||
l="${l} ${b}.o"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "flexcat: ${l}"
|
||||
echo " \${CC} \${CFLAGS} -o flexcat ${l} -lm"
|
||||
echo
|
||||
echo "clean:"
|
||||
echo " rm -f ${l} flexcat"
|
||||
echo
|
||||
} > build/flexcat/Makefile
|
||||
#########################################################################
|
||||
|
||||
echo "Makefile generated"
|
||||
|
|
13
src/amath.h
13
src/amath.h
|
@ -97,11 +97,12 @@
|
|||
/******************************************************************************/
|
||||
#ifdef AOS3
|
||||
# include <sys/types.h>
|
||||
# define IPTR LONG*
|
||||
typedef u_int8_t uint8_t;
|
||||
typedef u_int16_t uint16_t;
|
||||
typedef u_int32_t uint32_t;
|
||||
typedef u_int64_t uint64_t;
|
||||
# define IPTR LONG*
|
||||
# define uintptr_t uint32_t
|
||||
typedef u_int8_t uint8_t;
|
||||
typedef u_int16_t uint16_t;
|
||||
typedef u_int32_t uint32_t;
|
||||
typedef u_int64_t uint64_t;
|
||||
#endif
|
||||
/******************************************************************************/
|
||||
#if defined(AROS) || defined(MORPHOS) || defined(AOS4)
|
||||
|
@ -287,7 +288,7 @@ typedef int bool;
|
|||
#endif
|
||||
/******************************************************************************/
|
||||
#define TXTARCH TXTCPU TXTFPU
|
||||
#define RELDATESTAMP "(28-02-2017)"
|
||||
#define RELDATESTAMP "(12-03-2017)"
|
||||
#define TXTDOSVERSION "\0$VER: amath 1.70" SPACE RELDATESTAMP SPACE TXTARCH
|
||||
#define TXTTITLE "amath version 1.7.0"
|
||||
#define TXTCOPYRIGHT "(c) 2017 Carsten Sonne Larsen"
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26228.4
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amath", "amath.vcxproj", "{834DBB3E-042B-41E5-9400-EEC16CF003C7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Debug|x64.Build.0 = Debug|x64
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Debug|x86.Build.0 = Debug|Win32
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Release|x64.ActiveCfg = Release|x64
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Release|x64.Build.0 = Release|x64
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Release|x86.ActiveCfg = Release|Win32
|
||||
{834DBB3E-042B-41E5-9400-EEC16CF003C7}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{834DBB3E-042B-41E5-9400-EEC16CF003C7}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>amath</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,14 +1,20 @@
|
|||
CC = gcc
|
||||
CFLAGS = -std=c9x -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
PREFIX = /usr
|
||||
|
||||
alib = libamathc.a
|
||||
solib = libamathc.so
|
||||
CC = gcc
|
||||
CFLAGS = -std=c9x -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
LDCONFIG = ldconfig
|
||||
PREFIX = /usr
|
||||
INSTDIR = ${DESTDIR}${PREFIX}/lib/amath
|
||||
INSTDIRI = ${DESTDIR}${PREFIX}/include/amath
|
||||
INSTDIRPC = ${DESTDIR}${PREFIX}/lib/pkgconfig
|
||||
INSTDIRM = ${DESTDIR}${PREFIX}/share/man/man3
|
||||
alib = libamathc.a
|
||||
solib = libamathc.so
|
||||
pkgconfig = amathc.pc
|
||||
manpage = amathc.3
|
||||
|
||||
all: static shared
|
||||
|
||||
|
@ -64,7 +70,7 @@ build:
|
|||
${MKDIR} shared
|
||||
|
||||
${solib}: build shared/alloccpy.o shared/mem.o shared/memcpy.o shared/memset.o shared/strcmp.o shared/strlen.o shared/untag.o
|
||||
${CC} -shared -fPIC -Wl,-soname,${solib} -o ${solib} shared/alloccpy.o shared/mem.o shared/memcpy.o shared/memset.o shared/strcmp.o shared/strlen.o shared/untag.o -lc
|
||||
${CC} ${CFLAGS} -shared -s -fPIC -Wl,-soname,${solib}.1.7.0 -o ${solib} shared/alloccpy.o shared/mem.o shared/memcpy.o shared/memset.o shared/strcmp.o shared/strlen.o shared/untag.o -lc
|
||||
|
||||
${alib}: build static/alloccpy.o static/mem.o static/memcpy.o static/memset.o static/strcmp.o static/strlen.o static/untag.o
|
||||
${AR} rcs static/${alib} static/alloccpy.o static/mem.o static/memcpy.o static/memset.o static/strcmp.o static/strlen.o static/untag.o
|
||||
|
@ -72,19 +78,26 @@ ${alib}: build static/alloccpy.o static/mem.o static/memcpy.o static/memset.o s
|
|||
|
||||
.PHONY: install
|
||||
install: ${alib} ${solib}
|
||||
${MKDIR} ${DESTDIR}${PREFIX}/lib
|
||||
${MKDIR} ${DESTDIR}${PREFIX}/include
|
||||
${INSTALL} static/${alib} ${DESTDIR}${PREFIX}/lib/${alib}
|
||||
${INSTALL} ${solib} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
${INSTALL} ../amath.h ${DESTDIR}${PREFIX}/include
|
||||
${INSTALL} ../amathc.h ${DESTDIR}${PREFIX}/include
|
||||
${MKDIR} ${INSTDIR}
|
||||
${MKDIR} ${INSTDIRPC}
|
||||
${MKDIR} ${INSTDIRI}
|
||||
${INSTALL} static/${alib} ${INSTDIR}/${alib}
|
||||
${INSTALL} ${solib} ${INSTDIR}/${solib}
|
||||
${INSTALL} ${pkgconfig} ${INSTDIRPC}/${pkgconfig}
|
||||
${INSTALL} ${manpage} ${INSTDIRM}/${manpage}
|
||||
${INSTALL} ../amath.h ${INSTDIRI}
|
||||
${INSTALL} ../amathc.h ${INSTDIRI}
|
||||
${LDCONFIG} ${INSTDIR}
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
${DEL} ${DESTDIR}${PREFIX}/lib/${alib}
|
||||
${DEL} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
${DEL} ${DESTDIR}${PREFIX}/include/amath.h
|
||||
${DEL} ${DESTDIR}${PREFIX}/include/amathc.h
|
||||
${DEL} ${INSTDIR}/${alib}
|
||||
${DEL} ${INSTDIR}/${solib}
|
||||
${DEL} ${INSTDIRPC}/${pkgconfig}
|
||||
${DEL} ${INSTDIRM}/${manpage}
|
||||
${DEL} ${INSTDIRI}/amath.h
|
||||
${DEL} ${INSTDIRI}/amathc.h
|
||||
${LDCONFIG}
|
||||
|
||||
clean:
|
||||
${DEL} static/${alib} ${solib} static/alloccpy.o static/mem.o static/memcpy.o static/memset.o static/strcmp.o static/strlen.o static/untag.o shared/alloccpy.o shared/mem.o shared/memcpy.o shared/memset.o shared/strcmp.o shared/strlen.o shared/untag.o
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "amathc.h"
|
||||
|
||||
#ifdef AMIGA
|
||||
#ifdef AMIGA
|
||||
#include <clib/exec_protos.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1,519 @@
|
|||
.TH "amath/amathc.h" 3 "Wed Mar 1 2017" "Version 1.7.0" "amath" \" -*- nroff -*-
|
||||
.ad l
|
||||
.nh
|
||||
.SH NAME
|
||||
amathc.h \- C functions for manipulating strings and memory
|
||||
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.PP
|
||||
\fC#include <stddef\&.h>\fP
|
||||
.br
|
||||
\fC#include 'amath\&.h'\fP
|
||||
.br
|
||||
|
||||
.SS "Classes"
|
||||
|
||||
.in +1c
|
||||
.ti -1c
|
||||
.RI "struct \fBtexttag\fP"
|
||||
.br
|
||||
.in -1c
|
||||
.SS "Functions"
|
||||
|
||||
.in +1c
|
||||
.ti -1c
|
||||
.RI "void * \fBAllocMemSafe\fP (size_t)"
|
||||
.br
|
||||
.RI "\fIAllocate memory and add it to the global memory list\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBFreeMemSafe\fP (void *)"
|
||||
.br
|
||||
.RI "\fIDeallocate memory from the global memory list\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBFreeAllSafe\fP ()"
|
||||
.br
|
||||
.RI "\fIDeallocate all memory in the global memory list\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBMemUsage\fP (long *, long *, long *)"
|
||||
.br
|
||||
.RI "\fIGet memory usage in the global memory list\&. \fP"
|
||||
.ti -1c
|
||||
.RI "int \fBStrLen\fP (const char *string)"
|
||||
.br
|
||||
.RI "\fIGet the length of a null terminated string\&. \fP"
|
||||
.ti -1c
|
||||
.RI "\fBbool\fP \fBStrIsEqual\fP (const char *s1, const char *s2)"
|
||||
.br
|
||||
.RI "\fICompare two null terminated strings to each other\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBMemSet\fP (void *destination, int c0, unsigned int length)"
|
||||
.br
|
||||
.RI "\fIFill block of memory with a constant value\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBMemCopy\fP (void *destination, const void *source, unsigned int length)"
|
||||
.br
|
||||
.RI "\fICopy a block of memory, handling overlap\&. \fP"
|
||||
.ti -1c
|
||||
.RI "unsigned int \fBAllocAndCopy\fP (char **destination, const char *source)"
|
||||
.br
|
||||
.RI "\fIAllocate memory and copy a string into the array\&. \fP"
|
||||
.ti -1c
|
||||
.RI "void \fBUntag\fP (char *destination, const char *source, \fBtexttag\fP tags[], unsigned int tagcount)"
|
||||
.br
|
||||
.in -1c
|
||||
.SH "Detailed Description"
|
||||
.PP
|
||||
C functions for manipulating strings and memory\&.
|
||||
|
||||
|
||||
.PP
|
||||
Definition in file \fBamathc\&.h\fP\&.
|
||||
.SH "Function Documentation"
|
||||
.br
|
||||
.PP
|
||||
.SS "unsigned int AllocAndCopy (char ** destination, const char * source)"
|
||||
.br
|
||||
.PP
|
||||
Allocate memory and copy a string into the array\&.
|
||||
.PP
|
||||
Definition at line 40 of file alloccpy\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
41 {
|
||||
42 char *i, *s, *d;
|
||||
43 unsigned int n, size;
|
||||
44
|
||||
45 if (source == nullptr)
|
||||
46 {
|
||||
47 *destination = nullptr;
|
||||
48 return 0;
|
||||
49 }
|
||||
50
|
||||
51 i = (char*)source;
|
||||
52 s = (char*)source;
|
||||
53 while (*i)
|
||||
54 i++;
|
||||
55
|
||||
56 n = (unsigned int)(i - s + 1);
|
||||
57 size = n;
|
||||
58 *destination = AllocMemSafe(size);
|
||||
59 d = *destination;
|
||||
60
|
||||
61 #ifdef AMIGA // Take advantage of exec
|
||||
62 CopyMem(s, d, n);
|
||||
63 #else
|
||||
64 while (n--)
|
||||
65 *d++ = *s++;
|
||||
66 #endif
|
||||
67
|
||||
68 return size;
|
||||
69 }
|
||||
.fi
|
||||
.SS "void* AllocMemSafe (size_t)"
|
||||
|
||||
.PP
|
||||
Allocate memory and add it to the global memory list\&.
|
||||
.PP
|
||||
Definition at line 86 of file mem\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
87 {
|
||||
88 struct MemoryBlock* newblock;
|
||||
89 size_t allocsize;
|
||||
90
|
||||
91 if (list == NULL)
|
||||
92 {
|
||||
93 list = (struct MemoryList*)ALLOC_MEM(sizeof(struct MemoryList));
|
||||
94 if (!list)
|
||||
95 {
|
||||
96 alloc_error("list", sizeof(struct MemoryList));
|
||||
97 return 0;
|
||||
98 }
|
||||
99
|
||||
100 list->first = NULL;
|
||||
101 list->peak = 0;
|
||||
102 list->size = 0;
|
||||
103 list->count = 0;
|
||||
104 }
|
||||
105
|
||||
106 #ifdef P64BIT
|
||||
107 // Align to bytes of 8
|
||||
108 allocsize = (size + 7) & ~0x07;
|
||||
109 #else
|
||||
110 // Align to bytes of 4
|
||||
111 allocsize = (size + 3) & ~0x03;
|
||||
112 #endif
|
||||
113
|
||||
114 newblock = (struct MemoryBlock*)ALLOC_MEM(sizeof(struct MemoryBlock));
|
||||
115 if (!newblock)
|
||||
116 {
|
||||
117 alloc_error("block", sizeof(struct MemoryBlock));
|
||||
118 return 0;
|
||||
119 }
|
||||
120
|
||||
121 newblock->address = (struct MemoryBlock*)ALLOC_MEM(allocsize);
|
||||
122 if (!newblock->address)
|
||||
123 {
|
||||
124 FREE_MEM(newblock);
|
||||
125 alloc_error("memory", allocsize);
|
||||
126 return 0;
|
||||
127 }
|
||||
128
|
||||
129 newblock->size = allocsize;
|
||||
130 newblock->next = list->first;
|
||||
131 list->first = newblock;
|
||||
132 list->size += allocsize;
|
||||
133 list->count++;
|
||||
134
|
||||
135 if (list->size > list->peak)
|
||||
136 {
|
||||
137 list->peak = list->size;
|
||||
138 }
|
||||
139
|
||||
140 // Memory allocated
|
||||
141 return newblock->address;
|
||||
142 }
|
||||
.fi
|
||||
.SS "void FreeAllSafe ()"
|
||||
|
||||
.PP
|
||||
Deallocate all memory in the global memory list\&.
|
||||
.PP
|
||||
Definition at line 199 of file mem\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
200 {
|
||||
201 struct MemoryBlock *current, *next;
|
||||
202
|
||||
203 if (list == NULL)
|
||||
204 {
|
||||
205 return;
|
||||
206 }
|
||||
207
|
||||
208 current = list->first;
|
||||
209 while (current != NULL)
|
||||
210 {
|
||||
211 next = current->next;
|
||||
212 FREE_MEM(current->address);
|
||||
213 FREE_MEM(current);
|
||||
214 current = next;
|
||||
215 }
|
||||
216
|
||||
217 FREE_MEM(list);
|
||||
218 list = NULL;
|
||||
219 }
|
||||
.fi
|
||||
.SS "void FreeMemSafe (void *)"
|
||||
|
||||
.PP
|
||||
Deallocate memory from the global memory list\&.
|
||||
.PP
|
||||
Definition at line 147 of file mem\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
148 {
|
||||
149 struct MemoryBlock *current, *previous;
|
||||
150
|
||||
151 if (list == NULL || block == NULL)
|
||||
152 {
|
||||
153 dealloc_error("list", 0);
|
||||
154 return;
|
||||
155 }
|
||||
156
|
||||
157 if (block == NULL)
|
||||
158 {
|
||||
159 dealloc_error("memory", 0);
|
||||
160 return;
|
||||
161 }
|
||||
162
|
||||
163 previous = NULL;
|
||||
164 current = list->first;
|
||||
165 while (current != NULL && current->address != block)
|
||||
166 {
|
||||
167 previous = current;
|
||||
168 current = current->next;
|
||||
169 }
|
||||
170
|
||||
171 if (current == NULL)
|
||||
172 {
|
||||
173 dealloc_error("address not found", block);
|
||||
174 return;
|
||||
175 }
|
||||
176
|
||||
177 if (previous == NULL)
|
||||
178 {
|
||||
179 list->first = current->next;
|
||||
180 }
|
||||
181 else
|
||||
182 {
|
||||
183 previous->next = current->next;
|
||||
184 }
|
||||
185
|
||||
186 list->size -= current->size;
|
||||
187 list->count--;
|
||||
188
|
||||
189 FREE_MEM(current->address);
|
||||
190 current->address = NULL;
|
||||
191 current->next = NULL;
|
||||
192 current->size = 0;
|
||||
193 FREE_MEM(current);
|
||||
194 }
|
||||
.fi
|
||||
.SS "void MemCopy (void * destination, const void * source, unsigned int length)"
|
||||
|
||||
.PP
|
||||
Copy a block of memory, handling overlap\&.
|
||||
.PP
|
||||
Definition at line 77 of file memcpy\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
78 {
|
||||
79 char* dst = (char*) destination;
|
||||
80 const char* src = (const char*) source;
|
||||
81 unsigned int t;
|
||||
82
|
||||
83 if (length == 0 || dst == src) // nothing to do
|
||||
84 return;
|
||||
85
|
||||
86 if ((mem_ptr)dst < (mem_ptr)src)
|
||||
87 {
|
||||
88 // Copy forward
|
||||
89 #ifdef AMIGA // Take advantage of exec
|
||||
90 CopyMem((void*)source, destination, length);
|
||||
91 #else
|
||||
92 t = (mem_ptr)src; // only need low bits
|
||||
93 if ((t | (mem_ptr)dst) & wmask)
|
||||
94 {
|
||||
95 // Try to align operands\&. This cannot be done unless the low bits match\&.
|
||||
96 if ((t ^ (mem_ptr)dst) & wmask || length < wsize)
|
||||
97 t = length;
|
||||
98 else
|
||||
99 t = wsize - (t & wmask);
|
||||
100 length -= t;
|
||||
101
|
||||
102 TLOOP1(*dst++ = *src++);
|
||||
103 }
|
||||
104
|
||||
105 // Copy whole words, then mop up any trailing bytes\&.
|
||||
106 t = length / wsize;
|
||||
107 TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
|
||||
108
|
||||
109 t = length & wmask;
|
||||
110 TLOOP(*dst++ = *src++);
|
||||
111 #endif
|
||||
112 }
|
||||
113 else
|
||||
114 {
|
||||
115 // Copy backwards\&. Otherwise essentially the same\&.
|
||||
116 // Alignment works as before, except that it takes
|
||||
117 // (t&wmask) bytes to align, not wsize-(t&wmask)\&.
|
||||
118 src += length;
|
||||
119 dst += length;
|
||||
120 t = (mem_ptr)src;
|
||||
121 if ((t | (mem_ptr)dst) & wmask)
|
||||
122 {
|
||||
123 if ((t ^ (mem_ptr)dst) & wmask || length <= wsize)
|
||||
124 t = length;
|
||||
125 else
|
||||
126 t &= wmask;
|
||||
127 length -= t;
|
||||
128
|
||||
129 TLOOP1(*--dst = *--src);
|
||||
130 }
|
||||
131
|
||||
132 t = length / wsize;
|
||||
133 TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
|
||||
134
|
||||
135 t = length & wmask;
|
||||
136 TLOOP(*--dst = *--src);
|
||||
137 }
|
||||
138 }
|
||||
.fi
|
||||
.SS "void MemSet (void * destination, int c0, unsigned int length)"
|
||||
|
||||
.PP
|
||||
Fill block of memory with a constant value\&.
|
||||
.PP
|
||||
Definition at line 60 of file memset\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
61 {
|
||||
62 unsigned char* dst = (unsigned char*) dst0;
|
||||
63 unsigned int t;
|
||||
64 unsigned int c;
|
||||
65
|
||||
66 /*
|
||||
67 * If not enough words, just fill bytes\&. A length >= 2 words
|
||||
68 * guarantees that at least one of them is `complete' after
|
||||
69 * any necessary alignment\&. For instance:
|
||||
70 *
|
||||
71 * |-----------|-----------|-----------|
|
||||
72 * |00|01|02|03|04|05|06|07|08|09|0A|00|
|
||||
73 * ^---------------------^
|
||||
74 * dst dst+length-1
|
||||
75 *
|
||||
76 * but we use a minimum of 3 here since the overhead of the code
|
||||
77 * to do word writes is substantial\&.
|
||||
78 */
|
||||
79 if (length < 3 * wsize)
|
||||
80 {
|
||||
81 while (length != 0)
|
||||
82 {
|
||||
83 *dst++ = c0;
|
||||
84 --length;
|
||||
85 }
|
||||
86 }
|
||||
87
|
||||
88 if ((c = (unsigned char)c0) != 0)
|
||||
89 { /* Fill the word\&. */
|
||||
90 c = (c << 8) | c; /* u_int is 16 bits\&. */
|
||||
91 #if UINT_MAX > 0xffff
|
||||
92 c = (c << 16) | c; /* u_int is 32 bits\&. */
|
||||
93 #endif
|
||||
94 #if UINT_MAX > 0xffffffff
|
||||
95 c = (c << 32) | c; /* u_int is 64 bits\&. */
|
||||
96 #endif
|
||||
97 }
|
||||
98
|
||||
99 /* Align destination by filling in bytes\&. */
|
||||
100 if ((t = (mem_ptr)dst & wmask) != 0)
|
||||
101 {
|
||||
102 t = wsize - t;
|
||||
103 length -= t;
|
||||
104 do
|
||||
105 {
|
||||
106 *dst++ = c0;
|
||||
107 }
|
||||
108 while (--t != 0);
|
||||
109 }
|
||||
110
|
||||
111 /* Fill words\&. Length was >= 2*words so we know t >= 1 here\&. */
|
||||
112 t = length / wsize;
|
||||
113 do
|
||||
114 {
|
||||
115 *(unsigned int*)dst = c;
|
||||
116 dst += wsize;
|
||||
117 }
|
||||
118 while (--t != 0);
|
||||
119
|
||||
120 /* Mop up trailing bytes, if any\&. */
|
||||
121 t = length & wmask;
|
||||
122 if (t != 0)
|
||||
123 do
|
||||
124 {
|
||||
125 *dst++ = c0;
|
||||
126 }
|
||||
127 while (--t != 0);
|
||||
128 }
|
||||
.fi
|
||||
.SS "void MemUsage (long *, long *, long *)"
|
||||
|
||||
.PP
|
||||
Get memory usage in the global memory list\&.
|
||||
.PP
|
||||
Definition at line 224 of file mem\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
225 {
|
||||
226 *blocks = list->count;
|
||||
227 *size = (long)list->size;
|
||||
228 *peak = (long)list->peak;;
|
||||
229 }
|
||||
.fi
|
||||
.SS "\fBbool\fP StrIsEqual (const char * s1, const char * s2)"
|
||||
|
||||
.PP
|
||||
Compare two null terminated strings to each other\&.
|
||||
.PP
|
||||
Definition at line 50 of file strcmp\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
51 {
|
||||
52 int r;
|
||||
53
|
||||
54 while (*s1 == *s2++)
|
||||
55 if (*s1++ == '\0')
|
||||
56 return true;
|
||||
57
|
||||
58 r = (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
|
||||
59
|
||||
60 return r == 0;
|
||||
61 }
|
||||
.fi
|
||||
.SS "int StrLen (const char * string)"
|
||||
|
||||
.PP
|
||||
Get the length of a null terminated string\&.
|
||||
.PP
|
||||
Definition at line 34 of file strlen\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
35 {
|
||||
36 char* i = (char*)string;
|
||||
37 char* s = i;
|
||||
38 while (*i)
|
||||
39 i++;
|
||||
40 return (int)(i - s);
|
||||
41 }
|
||||
.fi
|
||||
.SS "void Untag (char * destination, const char * source, \fBtexttag\fP tags[], unsigned int tagcount)"
|
||||
|
||||
.PP
|
||||
Definition at line 32 of file untag\&.c\&.
|
||||
.PP
|
||||
.nf
|
||||
33 {
|
||||
34 const char *pos, *tmp, *tag;
|
||||
35 char* dest;
|
||||
36 int unsigned i, j, found;
|
||||
37
|
||||
38 pos = source;
|
||||
39 dest = destination;
|
||||
40
|
||||
41 while (*pos != '\0')
|
||||
42 {
|
||||
43 if (*pos != '#')
|
||||
44 {
|
||||
45 (*dest++ = *pos++);
|
||||
46 }
|
||||
47 else
|
||||
48 {
|
||||
49 // Try to replace tag
|
||||
50 found = 0;
|
||||
51 for (i = 0; i < tagcount; i++)
|
||||
52 {
|
||||
53 tag = tags[i]\&.tag;
|
||||
54 tmp = pos;
|
||||
55 j = 0;
|
||||
56 while (*tmp != '\0' && *tag != '\0' && *tmp == *tag)
|
||||
57 {
|
||||
58 tmp++;
|
||||
59 tag++;
|
||||
60 j++;
|
||||
61 }
|
||||
62
|
||||
63 if (j > 1 && *(--tag) == '#')
|
||||
64 {
|
||||
65 // Tag found\&. Now replace\&.
|
||||
66 tag = tags[i]\&.text;
|
||||
67 while ((*dest++ = *tag++));
|
||||
68 dest--;
|
||||
69 pos = tmp;
|
||||
70 found = 1;
|
||||
71 break;
|
||||
72 }
|
||||
73 }
|
||||
74
|
||||
75 if (!found)
|
||||
76 {
|
||||
77 (*dest++ = *pos++);
|
||||
78 }
|
||||
79 }
|
||||
80 }
|
||||
81 *dest = '\0';
|
||||
82 }
|
||||
.fi
|
||||
.SH "See also"
|
||||
.PP
|
||||
amath(1), amathr(3), amathi(3)
|
|
@ -0,0 +1,10 @@
|
|||
prefix=/usr
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include/amath
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
Name: amath C library
|
||||
Description: C functions for manipulating strings and memory
|
||||
Version: 1.7.0
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lamathc
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{01757088-637B-45D8-B042-14B76DF11115}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="alloccpy.c" />
|
||||
<ClCompile Include="mem.c" />
|
||||
<ClCompile Include="memcpy.c" />
|
||||
<ClCompile Include="memset.c" />
|
||||
<ClCompile Include="strcmp.c" />
|
||||
<ClCompile Include="strlen.c" />
|
||||
<ClCompile Include="untag.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="untag.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="strlen.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mem.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="alloccpy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="memcpy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="memset.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="strcmp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -26,7 +26,7 @@
|
|||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "amathc.h"
|
||||
|
||||
#ifdef AMIGA
|
||||
|
|
|
@ -47,28 +47,26 @@
|
|||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
#endif
|
||||
|
||||
#ifdef AMIGA
|
||||
#ifdef AMIGA
|
||||
#include <clib/exec_protos.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief
|
||||
* sizeof(word) MUST BE A POWER OF TWO
|
||||
* SO THAT wmask BELOW IS ALL ONES
|
||||
*/
|
||||
typedef uint32_t word;
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef unsigned long long mem_ptr;
|
||||
#else
|
||||
typedef unsigned long mem_ptr;
|
||||
#endif
|
||||
typedef uintptr_t mem_ptr;
|
||||
|
||||
/**
|
||||
*
|
||||
* Macros: loop-t-times; and loop-t-times, t>0
|
||||
* @brief loop-t-times
|
||||
*/
|
||||
#define TLOOP(s) if (t) TLOOP1(s)
|
||||
|
||||
/**
|
||||
* @brief loop-t-times, t>0
|
||||
*/
|
||||
#define TLOOP1(s) do { s; } while (--t)
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,11 +48,7 @@
|
|||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef unsigned long long mem_ptr;
|
||||
#else
|
||||
typedef unsigned long mem_ptr;
|
||||
#endif
|
||||
typedef uintptr_t mem_ptr;
|
||||
|
||||
/**
|
||||
* @brief Fill block of memory with a constant value.
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @file strcmp.h
|
||||
* @file strcmp.c
|
||||
* @brief Compare two null terminated strings to each other.
|
||||
*
|
||||
* Code originate from FreeBSD base, revision 229286.
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
CC = gcc
|
||||
CFLAGS = -std=c9x -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
PREFIX = /usr
|
||||
|
||||
alib = libamathcplex.a
|
||||
solib = libamathcplex.so
|
||||
CC = gcc
|
||||
CFLAGS = -std=c9x -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
LDCONFIG = ldconfig
|
||||
PREFIX = /usr
|
||||
INSTDIR = ${DESTDIR}${PREFIX}/lib/amath
|
||||
INSTDIRI = ${DESTDIR}${PREFIX}/include/amath
|
||||
INSTDIRPC = ${DESTDIR}${PREFIX}/lib/pkgconfig
|
||||
INSTDIRM = ${DESTDIR}${PREFIX}/share/man/man3
|
||||
alib = libamathcplex.a
|
||||
solib = libamathcplex.so
|
||||
pkgconfig = amathi.pc
|
||||
manpage = amathi.3
|
||||
|
||||
all: static shared
|
||||
|
||||
|
@ -220,7 +226,7 @@ build:
|
|||
${MKDIR} shared
|
||||
|
||||
${solib}: build shared/cacos.o shared/cacosh.o shared/cacot.o shared/cacoth.o shared/cacsc.o shared/cacsch.o shared/casec.o shared/casech.o shared/casin.o shared/casinh.o shared/catan.o shared/catanh.o shared/ccbrt.o shared/ccos.o shared/ccosh.o shared/ccot.o shared/ccoth.o shared/ccsc.o shared/ccsch.o shared/cexp.o shared/clog.o shared/clog10.o shared/clogb.o shared/cpow.o shared/csec.o shared/csech.o shared/csgn.o shared/csin.o shared/csinh.o shared/csqrt.o shared/ctan.o shared/ctanh.o shared/prim.o
|
||||
${CC} -shared -fPIC -Wl,-soname,${solib} -o ${solib} shared/cacos.o shared/cacosh.o shared/cacot.o shared/cacoth.o shared/cacsc.o shared/cacsch.o shared/casec.o shared/casech.o shared/casin.o shared/casinh.o shared/catan.o shared/catanh.o shared/ccbrt.o shared/ccos.o shared/ccosh.o shared/ccot.o shared/ccoth.o shared/ccsc.o shared/ccsch.o shared/cexp.o shared/clog.o shared/clog10.o shared/clogb.o shared/cpow.o shared/csec.o shared/csech.o shared/csgn.o shared/csin.o shared/csinh.o shared/csqrt.o shared/ctan.o shared/ctanh.o shared/prim.o
|
||||
${CC} ${CFLAGS} -shared -s -fPIC -Wl,-soname,${solib}.1.7.0 -o ${solib} shared/cacos.o shared/cacosh.o shared/cacot.o shared/cacoth.o shared/cacsc.o shared/cacsch.o shared/casec.o shared/casech.o shared/casin.o shared/casinh.o shared/catan.o shared/catanh.o shared/ccbrt.o shared/ccos.o shared/ccosh.o shared/ccot.o shared/ccoth.o shared/ccsc.o shared/ccsch.o shared/cexp.o shared/clog.o shared/clog10.o shared/clogb.o shared/cpow.o shared/csec.o shared/csech.o shared/csgn.o shared/csin.o shared/csinh.o shared/csqrt.o shared/ctan.o shared/ctanh.o shared/prim.o
|
||||
|
||||
${alib}: build static/cacos.o static/cacosh.o static/cacot.o static/cacoth.o static/cacsc.o static/cacsch.o static/casec.o static/casech.o static/casin.o static/casinh.o static/catan.o static/catanh.o static/ccbrt.o static/ccos.o static/ccosh.o static/ccot.o static/ccoth.o static/ccsc.o static/ccsch.o static/cexp.o static/clog.o static/clog10.o static/clogb.o static/cpow.o static/csec.o static/csech.o static/csgn.o static/csin.o static/csinh.o static/csqrt.o static/ctan.o static/ctanh.o static/prim.o
|
||||
${AR} rcs static/${alib} static/cacos.o static/cacosh.o static/cacot.o static/cacoth.o static/cacsc.o static/cacsch.o static/casec.o static/casech.o static/casin.o static/casinh.o static/catan.o static/catanh.o static/ccbrt.o static/ccos.o static/ccosh.o static/ccot.o static/ccoth.o static/ccsc.o static/ccsch.o static/cexp.o static/clog.o static/clog10.o static/clogb.o static/cpow.o static/csec.o static/csech.o static/csgn.o static/csin.o static/csinh.o static/csqrt.o static/ctan.o static/ctanh.o static/prim.o
|
||||
|
@ -228,16 +234,25 @@ ${alib}: build static/cacos.o static/cacosh.o static/cacot.o static/cacoth.o st
|
|||
|
||||
.PHONY: install
|
||||
install: ${alib} ${solib}
|
||||
${MKDIR} ${DESTDIR}${PREFIX}/lib
|
||||
${INSTALL} static/${alib} ${DESTDIR}${PREFIX}/lib/${alib}
|
||||
${INSTALL} ${solib} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
${INSTALL} ../complex.h ${DESTDIR}${PREFIX}/include
|
||||
${MKDIR} ${INSTDIR}
|
||||
${MKDIR} ${INSTDIRPC}
|
||||
${MKDIR} ${INSTDIRI}
|
||||
${INSTALL} static/${alib} ${INSTDIR}/${alib}
|
||||
${INSTALL} ${solib} ${INSTDIR}/${solib}
|
||||
${INSTALL} ${pkgconfig} ${INSTDIRPC}/${pkgconfig}
|
||||
${INSTALL} ${manpage} ${INSTDIRM}/${manpage}
|
||||
${INSTALL} ../complex.h ${INSTDIRI}/amathi.h
|
||||
${LDCONFIG} ${INSTDIR}
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
${DEL} ${DESTDIR}${PREFIX}/lib/${alib}
|
||||
${DEL} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
${DEL} ${DESTDIR}${PREFIX}/include/complex.h
|
||||
${DEL} ${INSTDIR}/${alib}
|
||||
${DEL} ${INSTDIR}/${solib}
|
||||
${DEL} ${INSTDIRPC}/${pkgconfig}
|
||||
${DEL} ${INSTDIRM}/${manpage}
|
||||
${DEL} ${INSTDIRPC}/amathi.pc
|
||||
${DEL} ${INSTDIRI}/amathi.h
|
||||
${LDCONFIG}
|
||||
|
||||
clean:
|
||||
${DEL} static/${alib} ${solib} static/cacos.o static/cacosh.o static/cacot.o static/cacoth.o static/cacsc.o static/cacsch.o static/casec.o static/casech.o static/casin.o static/casinh.o static/catan.o static/catanh.o static/ccbrt.o static/ccos.o static/ccosh.o static/ccot.o static/ccoth.o static/ccsc.o static/ccsch.o static/cexp.o static/clog.o static/clog10.o static/clogb.o static/cpow.o static/csec.o static/csech.o static/csgn.o static/csin.o static/csinh.o static/csqrt.o static/ctan.o static/ctanh.o static/prim.o shared/cacos.o shared/cacosh.o shared/cacot.o shared/cacoth.o shared/cacsc.o shared/cacsch.o shared/casec.o shared/casech.o shared/casin.o shared/casinh.o shared/catan.o shared/catanh.o shared/ccbrt.o shared/ccos.o shared/ccosh.o shared/ccot.o shared/ccoth.o shared/ccsc.o shared/ccsch.o shared/cexp.o shared/clog.o shared/clog10.o shared/clogb.o shared/cpow.o shared/csec.o shared/csech.o shared/csgn.o shared/csin.o shared/csinh.o shared/csqrt.o shared/ctan.o shared/ctanh.o shared/prim.o
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
|||
prefix=/usr
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include/amath
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
Name: amath complex library
|
||||
Description: Functions for handling complex numbers
|
||||
Version: 1.7.0
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lamathi
|
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{278A3E34-C1F0-4176-AA98-6D8CD4F16438}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="cacos.c" />
|
||||
<ClCompile Include="cacosh.c" />
|
||||
<ClCompile Include="cacot.c" />
|
||||
<ClCompile Include="cacoth.c" />
|
||||
<ClCompile Include="cacsc.c" />
|
||||
<ClCompile Include="cacsch.c" />
|
||||
<ClCompile Include="casec.c" />
|
||||
<ClCompile Include="casech.c" />
|
||||
<ClCompile Include="casin.c" />
|
||||
<ClCompile Include="casinh.c" />
|
||||
<ClCompile Include="catan.c" />
|
||||
<ClCompile Include="catanh.c" />
|
||||
<ClCompile Include="ccbrt.c" />
|
||||
<ClCompile Include="ccos.c" />
|
||||
<ClCompile Include="ccosh.c" />
|
||||
<ClCompile Include="ccot.c" />
|
||||
<ClCompile Include="ccoth.c" />
|
||||
<ClCompile Include="ccsc.c" />
|
||||
<ClCompile Include="ccsch.c" />
|
||||
<ClCompile Include="cexp.c" />
|
||||
<ClCompile Include="clog.c" />
|
||||
<ClCompile Include="clog10.c" />
|
||||
<ClCompile Include="clogb.c" />
|
||||
<ClCompile Include="cpow.c" />
|
||||
<ClCompile Include="csec.c" />
|
||||
<ClCompile Include="csech.c" />
|
||||
<ClCompile Include="csgn.c" />
|
||||
<ClCompile Include="csin.c" />
|
||||
<ClCompile Include="csinh.c" />
|
||||
<ClCompile Include="csqrt.c" />
|
||||
<ClCompile Include="ctan.c" />
|
||||
<ClCompile Include="ctanh.c" />
|
||||
<ClCompile Include="prim.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="prim.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="casech.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="casin.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccsc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ctan.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="clog10.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccot.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacos.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccoth.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="catanh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="prim.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cexp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csinh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccos.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacoth.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacsch.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="clogb.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="casec.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csqrt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csech.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccbrt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ctanh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="clog.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacsc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cpow.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccosh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacosh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csgn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="casinh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csin.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="csec.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="catan.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cacot.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ccsch.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="prim.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -46,7 +46,7 @@
|
|||
complex cacosh(complex z)
|
||||
{
|
||||
complex one = cpack(1.0, 0.0);
|
||||
complex a = csub(cmul(z, z) , one);
|
||||
complex a = csub(cmul(z, z), one);
|
||||
complex b = cadd(z, csqrt(a));
|
||||
complex w = clog(b);
|
||||
return w;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "prim.h"
|
||||
#include "math.h"
|
||||
#include "complex.h"
|
||||
|
@ -57,9 +57,12 @@ complex ccot(complex z)
|
|||
b = cimag(z);
|
||||
d = cosh(2.0 * b) - cos(2.0 * a);
|
||||
|
||||
if (d == 0.0) {
|
||||
if (d == 0.0)
|
||||
{
|
||||
w = cpack(D_INFP, D_INFP);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w = cpack((sin(2.0 * a) / d), (-sinh(2.0 * b) / d));
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,12 @@ complex ccsc(complex z)
|
|||
b = cimag(z);
|
||||
d = cosh(2.0 * b) - cos(2.0 * a);
|
||||
|
||||
if (d == 0.0) {
|
||||
if (d == 0.0)
|
||||
{
|
||||
w = cpack(D_INFP, D_INFP);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w = cpack((2.0 * sin(a) * cosh(b) / d), (-2.0 * cos(a) * sinh(b) / d));
|
||||
}
|
||||
|
||||
|
|
|
@ -52,14 +52,16 @@ complex cpow(complex a, complex z)
|
|||
x = creal(z);
|
||||
y = cimag(z);
|
||||
absa = cabs(a);
|
||||
if (absa == 0.0) {
|
||||
if (absa == 0.0)
|
||||
{
|
||||
return cpack(0.0, + 0.0);
|
||||
}
|
||||
arga = atan2(cimag(a), creal(a));
|
||||
|
||||
r = pow(absa, x);
|
||||
theta = x * arga;
|
||||
if (y != 0.0) {
|
||||
if (y != 0.0)
|
||||
{
|
||||
r = r * exp(-y * arga);
|
||||
theta = theta + y * log(absa);
|
||||
}
|
||||
|
|
|
@ -57,9 +57,12 @@ complex csec(complex z)
|
|||
b = cimag(z);
|
||||
d = cosh(2.0 * b) + cos(2.0 * a);
|
||||
|
||||
if (d == 0.0) {
|
||||
if (d == 0.0)
|
||||
{
|
||||
w = cpack(D_INFP, D_INFP);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w = cpack((2.0 * cos(a) * cosh(b) / d), (2.0 * sin(a) * sinh(b) / d));
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,16 @@ double csgn(complex z)
|
|||
{
|
||||
double a = creal(z);
|
||||
|
||||
if (a > 0.0) {
|
||||
if (a > 0.0)
|
||||
{
|
||||
return 1.0;
|
||||
} else if (a < 0.0) {
|
||||
}
|
||||
else if (a < 0.0)
|
||||
{
|
||||
return -1.0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
double b = cimag(z);
|
||||
return b > 0.0 ? 1.0 : b < 0.0 ? -1.0 : 0.0;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "prim.h"
|
||||
#include "math.h"
|
||||
#include "complex.h"
|
||||
|
|
|
@ -49,40 +49,51 @@ complex csqrt(complex z)
|
|||
complex w;
|
||||
double x, y, r, t, scale;
|
||||
|
||||
x = creal (z);
|
||||
y = cimag (z);
|
||||
x = creal(z);
|
||||
y = cimag(z);
|
||||
|
||||
if (y == 0.0) {
|
||||
if (x == 0.0) {
|
||||
if (y == 0.0)
|
||||
{
|
||||
if (x == 0.0)
|
||||
{
|
||||
w = cpack(0.0, y);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
r = fabs(x);
|
||||
r = sqrt(r);
|
||||
if (x < 0.0) {
|
||||
if (x < 0.0)
|
||||
{
|
||||
w = cpack(0.0, r);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w = cpack(r, y);
|
||||
}
|
||||
}
|
||||
return w;
|
||||
}
|
||||
if (x == 0.0) {
|
||||
if (x == 0.0)
|
||||
{
|
||||
r = fabs(y);
|
||||
r = sqrt(0.5 * r);
|
||||
if (y > 0)
|
||||
w = cpack(r, r);
|
||||
w = cpack(r, r);
|
||||
else
|
||||
w = cpack(r, -r);
|
||||
return w;
|
||||
}
|
||||
/* Rescale to avoid internal overflow or underflow. */
|
||||
if ((fabs(x) > 4.0) || (fabs(y) > 4.0)) {
|
||||
if ((fabs(x) > 4.0) || (fabs(y) > 4.0))
|
||||
{
|
||||
x *= 0.25;
|
||||
y *= 0.25;
|
||||
scale = 2.0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 1
|
||||
x *= 1.8014398509481984e16; /* 2^54 */
|
||||
x *= 1.8014398509481984e16; /* 2^54 */
|
||||
y *= 1.8014398509481984e16;
|
||||
scale = 7.450580596923828125e-9; /* 2^-27 */
|
||||
#else
|
||||
|
@ -93,11 +104,14 @@ complex csqrt(complex z)
|
|||
}
|
||||
w = cpack(x, y);
|
||||
r = cabs(w);
|
||||
if (x > 0) {
|
||||
if (x > 0)
|
||||
{
|
||||
t = sqrt(0.5 * r + 0.5 * x);
|
||||
r = scale * fabs((0.5 * y) / t );
|
||||
r = scale * fabs((0.5 * y) / t);
|
||||
t *= scale;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
r = sqrt(0.5 * r - 0.5 * x);
|
||||
t = scale * fabs((0.5 * y) / r);
|
||||
r *= scale;
|
||||
|
|
|
@ -66,9 +66,12 @@ complex ctan(complex z)
|
|||
b = cimag(z);
|
||||
d = cos(2.0 * a) + cosh(2.0 * b);
|
||||
|
||||
if (d == 0.0) {
|
||||
if (d == 0.0)
|
||||
{
|
||||
w = cpack(D_INFP, D_INFP);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w = cpack((sin(2.0 * a) / d), (sinh(2.0 * b) / d));
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define AMATH_LIB_COMPLEX_PRIM_H
|
||||
|
||||
/**
|
||||
* @file prim.h
|
||||
* @file cplex/prim.h
|
||||
* @brief Primitives in math library for handling complex numbers.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
CXX = g++
|
||||
CXXFLAGS = -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
PREFIX = /usr
|
||||
|
||||
alib = libamathapp.a
|
||||
solib = libamathapp.so
|
||||
CXX = g++
|
||||
CXXFLAGS = -O3 -DWITHTEST -I. -I.. -Wall
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR = mkdir -p
|
||||
DEL = rm -f
|
||||
INSTALL = install -m 0644
|
||||
LDCONFIG = ldconfig
|
||||
PREFIX = /usr
|
||||
INSTDIR = ${DESTDIR}${PREFIX}/lib/amath
|
||||
INSTDIRI = ${DESTDIR}${PREFIX}/include/amath
|
||||
INSTDIRPC = ${DESTDIR}${PREFIX}/lib/pkgconfig
|
||||
alib = libamathapp.a
|
||||
solib = libamathapp.so
|
||||
pkgconfig = amatha.pc
|
||||
|
||||
all: static shared
|
||||
|
||||
|
@ -64,20 +68,44 @@ build:
|
|||
${MKDIR} shared
|
||||
|
||||
${solib}: build shared/aengine.o shared/charbuf.o shared/integer.o shared/cplex.o shared/nnumb.o shared/ntext.o shared/real.o
|
||||
${CC} -shared -fPIC -Wl,-soname,${solib} -o ${solib} shared/aengine.o shared/charbuf.o shared/integer.o shared/cplex.o shared/nnumb.o shared/ntext.o shared/real.o
|
||||
${CXX} ${CXXFLAGS} -shared -s -fPIC -Wl,-soname,${solib}.1.7.0 -o ${solib} shared/aengine.o shared/charbuf.o shared/integer.o shared/cplex.o shared/nnumb.o shared/ntext.o shared/real.o
|
||||
|
||||
${alib}: build static/aengine.o static/charbuf.o static/integer.o static/cplex.o static/nnumb.o static/ntext.o static/real.o
|
||||
${AR} rcs static/${alib} static/aengine.o static/charbuf.o static/integer.o static/cplex.o static/nnumb.o static/ntext.o static/real.o
|
||||
${RANLIB} static/${alib}
|
||||
|
||||
.PHONY: install
|
||||
install: ${solib}
|
||||
${MKDIR} ${DESTDIR}${PREFIX}/lib
|
||||
${INSTALL} ${solib} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
.PHONY: install
|
||||
install: ${alib} ${solib}
|
||||
${MKDIR} ${INSTDIR}
|
||||
${MKDIR} ${INSTDIRPC}
|
||||
${MKDIR} ${INSTDIRI}
|
||||
${INSTALL} static/${alib} ${INSTDIR}/${alib}
|
||||
${INSTALL} ${solib} ${INSTDIR}/${solib}
|
||||
${INSTALL} ${pkgconfig} ${INSTDIRPC}/${pkgconfig}
|
||||
${INSTALL} aengine.h ${INSTDIRI}/aengine.h
|
||||
${INSTALL} charbuf.h ${INSTDIRI}/charbuf.h
|
||||
${INSTALL} cplex.h ${INSTDIRI}/cplex.h
|
||||
${INSTALL} integer.h ${INSTDIRI}/integer.h
|
||||
${INSTALL} nnumb.h ${INSTDIRI}/nnumb.h
|
||||
${INSTALL} ntext.h ${INSTDIRI}/ntext.h
|
||||
${INSTALL} numb.h ${INSTDIRI}/numb.h
|
||||
${INSTALL} real.h ${INSTDIRI}/real.h
|
||||
${LDCONFIG} ${INSTDIR}
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
${DEL} ${DESTDIR}${PREFIX}/lib/${solib}
|
||||
${DEL} ${INSTDIR}/${alib}
|
||||
${DEL} ${INSTDIR}/${solib}
|
||||
${DEL} ${INSTDIRPC}/${pkgconfig}
|
||||
${DEL} ${INSTDIRI}/aengine.h
|
||||
${DEL} ${INSTDIRI}/charbuf.h
|
||||
${DEL} ${INSTDIRI}/cplex.h
|
||||
${DEL} ${INSTDIRI}/integer.h
|
||||
${DEL} ${INSTDIRI}/nnumb.h
|
||||
${DEL} ${INSTDIRI}/ntext.h
|
||||
${DEL} ${INSTDIRI}/numb.h
|
||||
${DEL} ${INSTDIRI}/real.h
|
||||
${LDCONFIG}
|
||||
|
||||
clean:
|
||||
${DEL} static/${alib} ${solib} static/aengine.o static/charbuf.o static/integer.o static/cplex.o static/nnumb.o static/ntext.o static/real.o shared/aengine.o shared/charbuf.o shared/integer.o shared/cplex.o shared/nnumb.o shared/ntext.o shared/real.o
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
prefix=/usr
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include/amath
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
Name: amath application library
|
||||
Description: C++ library for handling numbers
|
||||
Version: 1.7.0
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lamathapp -lamathr -lamathi -lamathc
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{B2BC043B-5799-4D01-96B0-C7871F7734FB}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="aengine.cpp" />
|
||||
<ClCompile Include="charbuf.cpp" />
|
||||
<ClCompile Include="cplex.cpp" />
|
||||
<ClCompile Include="integer.cpp" />
|
||||
<ClCompile Include="nnumb.cpp" />
|
||||
<ClCompile Include="ntext.cpp" />
|
||||
<ClCompile Include="real.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="aengine.h" />
|
||||
<ClInclude Include="charbuf.h" />
|
||||
<ClInclude Include="charval.h" />
|
||||
<ClInclude Include="cplex.h" />
|
||||
<ClInclude Include="integer.h" />
|
||||
<ClInclude Include="nnumb.h" />
|
||||
<ClInclude Include="ntext.h" />
|
||||
<ClInclude Include="numb.h" />
|
||||
<ClInclude Include="real.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="charbuf.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="real.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cplex.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ntext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="nnumb.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="aengine.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="integer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="charbuf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ntext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="nnumb.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cplex.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="real.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="aengine.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="integer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="numb.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="charval.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -30,9 +30,13 @@
|
|||
#ifndef AMATH_CHAR_VALIDATOR_H
|
||||
#define AMATH_CHAR_VALIDATOR_H
|
||||
|
||||
class CharValidator {
|
||||
class CharValidator
|
||||
{
|
||||
public:
|
||||
virtual ~CharValidator() {}
|
||||
virtual ~CharValidator()
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool Validate(char c) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -273,8 +273,7 @@ Number* ComplexNumber::Raise(Number* exponent)
|
|||
|
||||
Number* ComplexNumber::Factorial()
|
||||
{
|
||||
// TODO
|
||||
return new RealNumber(1);
|
||||
return new NonNumber(nnnimp);
|
||||
}
|
||||
|
||||
Number* ComplexNumber::Signum()
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
bool IsTooSmall();
|
||||
bool IsTooLarge();
|
||||
bool IsNotImplemented();
|
||||
|
||||
|
||||
Number* Unary();
|
||||
Number* Add(Number* other);
|
||||
Number* Sub(Number* other);
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
Number* HaVerCosine();
|
||||
Number* HaCoVerSine();
|
||||
Number* HaCoVerCosine();
|
||||
|
||||
|
||||
Number* ArcVerSine();
|
||||
Number* ArcVerCosine();
|
||||
Number* ArcCoVerSine();
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
Number* ArcHaVerCosine();
|
||||
Number* ArcHaCoVerSine();
|
||||
Number* ArcHaCoVerCosine();
|
||||
|
||||
|
||||
Number* ExSecant();
|
||||
Number* ExCosecant();
|
||||
Number* ArcExSecant();
|
||||
|
|
|
@ -378,7 +378,6 @@ Number* IntegerNumber::Log()
|
|||
*/
|
||||
Number* IntegerNumber::Log10()
|
||||
{
|
||||
|
||||
if (i == 0)
|
||||
return new NonNumber(nnnan);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
bool IsTooSmall();
|
||||
bool IsTooLarge();
|
||||
bool IsNotImplemented();
|
||||
|
||||
|
||||
Number* Unary();
|
||||
Number* Add(Number* other);
|
||||
Number* Sub(Number* other);
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
Number* HaVerCosine();
|
||||
Number* HaCoVerSine();
|
||||
Number* HaCoVerCosine();
|
||||
|
||||
|
||||
Number* ArcVerSine();
|
||||
Number* ArcVerCosine();
|
||||
Number* ArcCoVerSine();
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
Number* ArcHaVerCosine();
|
||||
Number* ArcHaCoVerSine();
|
||||
Number* ArcHaCoVerCosine();
|
||||
|
||||
|
||||
Number* ExSecant();
|
||||
Number* ExCosecant();
|
||||
Number* ArcExSecant();
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
bool IsTooSmall();
|
||||
bool IsTooLarge();
|
||||
bool IsNotImplemented();
|
||||
|
||||
|
||||
Number* Unary();
|
||||
Number* Add(Number* other);
|
||||
Number* Sub(Number* other);
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
Number* HaVerCosine();
|
||||
Number* HaCoVerSine();
|
||||
Number* HaCoVerCosine();
|
||||
|
||||
|
||||
Number* ArcVerSine();
|
||||
Number* ArcVerCosine();
|
||||
Number* ArcCoVerSine();
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
Number* ArcHaVerCosine();
|
||||
Number* ArcHaCoVerSine();
|
||||
Number* ArcHaCoVerCosine();
|
||||
|
||||
|
||||
Number* ExSecant();
|
||||
Number* ExCosecant();
|
||||
Number* ArcExSecant();
|
||||
|
|
|
@ -135,7 +135,7 @@ const char* PositionalNumeralSystem::GetText(Number* number)
|
|||
buf->Append("NaN");
|
||||
return buf->GetString();
|
||||
}
|
||||
|
||||
|
||||
if (number->IsNotImplemented())
|
||||
{
|
||||
buf->Empty();
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
virtual bool IsTooSmall() = 0;
|
||||
virtual bool IsTooLarge() = 0;
|
||||
virtual bool IsNotImplemented() = 0;
|
||||
|
||||
|
||||
virtual Number* Unary() = 0;
|
||||
virtual Number* Add(Number* other) = 0;
|
||||
virtual Number* Sub(Number* other) = 0;
|
||||
|
@ -132,7 +132,7 @@ public:
|
|||
virtual Number* HaVerCosine() = 0;
|
||||
virtual Number* HaCoVerSine() = 0;
|
||||
virtual Number* HaCoVerCosine() = 0;
|
||||
|
||||
|
||||
virtual Number* ArcVerSine() = 0;
|
||||
virtual Number* ArcVerCosine() = 0;
|
||||
virtual Number* ArcCoVerSine() = 0;
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
virtual Number* ArcHaVerCosine() = 0;
|
||||
virtual Number* ArcHaCoVerSine() = 0;
|
||||
virtual Number* ArcHaCoVerCosine() = 0;
|
||||
|
||||
|
||||
virtual Number* ExSecant() = 0;
|
||||
virtual Number* ExCosecant() = 0;
|
||||
virtual Number* ArcExSecant() = 0;
|
||||
|
|
|
@ -382,7 +382,7 @@ Number* RealNumber::CubeRoot()
|
|||
Number* RealNumber::Reciprocal()
|
||||
{
|
||||
if (x != 0.0)
|
||||
return new RealNumber(1 / x);
|
||||
return new RealNumber(1.0 / x);
|
||||
|
||||
return new NonNumber(nnnan);
|
||||
}
|
||||
|
@ -393,21 +393,7 @@ Number* RealNumber::Reciprocal()
|
|||
*/
|
||||
Number* RealNumber::Factorial()
|
||||
{
|
||||
int l = (int)trunc(x);
|
||||
double r = 1;
|
||||
int c;
|
||||
|
||||
// TODO: Fix
|
||||
if (l < 0)
|
||||
return new RealNumber(0);
|
||||
|
||||
if (l == 0)
|
||||
return new RealNumber(1);
|
||||
|
||||
for (c = 1; c <= l; c++)
|
||||
r = r * c;
|
||||
|
||||
return new RealNumber(r);
|
||||
return new NonNumber(nnnimp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -825,7 +811,7 @@ Number* RealNumber::ArcCoVerSine()
|
|||
{
|
||||
if (x < 0.0 || x > 2.0)
|
||||
return new NonNumber(nnnan);
|
||||
|
||||
|
||||
return new RealNumber(acvs(x));
|
||||
}
|
||||
|
||||
|
@ -838,7 +824,7 @@ Number* RealNumber::ArcHaVerSine()
|
|||
{
|
||||
if (x < 0.0 || x > 1.0)
|
||||
return new NonNumber(nnnan);
|
||||
|
||||
|
||||
return new RealNumber(ahv(x));
|
||||
}
|
||||
|
||||
|
@ -869,14 +855,12 @@ Number* RealNumber::ExCosecant()
|
|||
|
||||
Number* RealNumber::ArcExSecant()
|
||||
{
|
||||
if (x <= -2.0 || x >= 0.0)
|
||||
{
|
||||
double a = x * x + 2 * x;
|
||||
double b = sqrt(a);
|
||||
return new RealNumber(atan(b));
|
||||
}
|
||||
if (x > -2.0 && x < 0.0)
|
||||
return new NonNumber(nnnan);
|
||||
|
||||
return new NonNumber(nnnan);
|
||||
double a = x * x + 2 * x;
|
||||
double b = sqrt(a);
|
||||
return new RealNumber(atan(b));
|
||||
}
|
||||
|
||||
Number* RealNumber::ArcExCosecant()
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
Number* HaVerCosine();
|
||||
Number* HaCoVerSine();
|
||||
Number* HaCoVerCosine();
|
||||
|
||||
|
||||
Number* ArcVerSine();
|
||||
Number* ArcVerCosine();
|
||||
Number* ArcCoVerSine();
|
||||
|
@ -132,7 +132,7 @@ public:
|
|||
Number* ArcHaVerCosine();
|
||||
Number* ArcHaCoVerSine();
|
||||
Number* ArcHaCoVerCosine();
|
||||
|
||||
|
||||
Number* ExSecant();
|
||||
Number* ExCosecant();
|
||||
Number* ArcExSecant();
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define AMATH_LOCALIZE_HELP_H
|
||||
|
||||
/**
|
||||
* @file help.h
|
||||
* @file localize/help.h
|
||||
* @brief Help texts for statement.
|
||||
*
|
||||
*/
|
||||
|
@ -54,40 +54,42 @@ struct helptextdef
|
|||
};
|
||||
|
||||
static const helptextdef helptexts[] = {
|
||||
{0, symzero, "Enter command or expression to evaluate.#NEWLINE##SYNTAXHIGHLIGHT#Example: 2+3-cos(3)#NORMALTEXT##NEWLINE# #NEWLINE#More help is available for designated topics.#NEWLINE#-------------------------------------------------#NEWLINE#functions Base functions.#NEWLINE#trigon Trigonometric functions.#NEWLINE#hyper Hyperbolic functions.#NEWLINE#complex Syntax for complex numbers.#NEWLINE#statements Available statements.#NEWLINE#operators Supported operators.#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: help trigon#NEWLINE#"},
|
||||
{1, symoperator, "-------------------------------------------------#NEWLINE# + Mathematical addition.#NEWLINE# - Mathematical subtraction.#NEWLINE# * Mathematical multiplication.#NEWLINE# / Mathematical division.#NEWLINE# ^ Mathematical exponentiation.#NEWLINE# = Assignment of variable values.#NEWLINE# | Absolute value of number. #NEWLINE#-------------------------------------------------#NEWLINE#"},
|
||||
{2, symfunction, "-------------------------------------------------#NEWLINE#abs Absolute value of number.#NEWLINE#sgn Mathematical signum function.#NEWLINE#round Round to nearest integer number.#NEWLINE#trunc Discard fraction part of number.#NEWLINE#floor Mathematical floor function.#NEWLINE#ceil Mathematical ceiling function.#NEWLINE#sqrt Square root function (exp 1/2).#NEWLINE#cbrt Cube root function (exp 1/3).#NEWLINE#lb Binary logarithm function (base 2).#NEWLINE#ln Natural logarithm function (base e).#NEWLINE#lg Common logarithm function (base 10).#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: round(1.55)#NORMALTEXT##NEWLINE#"},
|
||||
{3, symtrigon, "-------------------------------------------------#NEWLINE#sin Trigonometric sine function.#NEWLINE#cos Trigonometric cosine function.#NEWLINE#tan Trigonometric tangent function.#NEWLINE#cot Trigonometric cotangent function.#NEWLINE#sec Trigonometric secant function.#NEWLINE#csc Trigonometric cosecant function.#NEWLINE#asin Inverse trigonometric sine function.#NEWLINE#acos Inverse trigonometric cosine function.#NEWLINE#atan Inverse trigonometric tangent function.#NEWLINE#acot Inverse trigonometric cotangent function.#NEWLINE#asec Inverse trigonometric secant function.#NEWLINE#acsc Inverse trigonometric cosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#"},
|
||||
{4, symhyper, "-------------------------------------------------#NEWLINE#sinh Hyperbolic sine function.#NEWLINE#cosh Hyperbolic cosine function.#NEWLINE#tanh Hyperbolic tangent function.#NEWLINE#coth Hyperbolic cotangent function.#NEWLINE#sech Hyperbolic secant function.#NEWLINE#csch Hyperbolic cosecant function. #NEWLINE#asinh Inverse hyperbolic sine function.#NEWLINE#acosh Inverse hyperbolic cosine function.#NEWLINE#atanh Inverse hyperbolic tangent function.#NEWLINE#acoth Inverse hyperbolic cotangent function.#NEWLINE#asech Inverse hyperbolic secant function.#NEWLINE#acsch Inverse hyperbolic cosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#"},
|
||||
{5, symstatement, "---------------------------------------------------------#NEWLINE#clear Clear console window.#NEWLINE#def Define function.#NEWLINE#delete Delete variable or function.#NEWLINE#digits Set number of significant digits.#NEWLINE#eval Evaluate arithmetic expression.#NEWLINE#execute Execute statements in a file.#NEWLINE#functions Show list of user defined functions.#NEWLINE#input Change numeral input system.#NEWLINE#help Show basic help text.#NEWLINE#output Change numeral output system.#NEWLINE#list Show content of a directory.#NEWLINE#show Show content of a file.#NEWLINE#load Load variable and functions from file.#NEWLINE#save Save variable and functions to file.#NEWLINE#variables Show list of variables.#NEWLINE#version Show version string.#NEWLINE#memory Show internal memory usage.#NEWLINE#exit Exit program.#NEWLINE#---------------------------------------------------------#NEWLINE#The def and eval statements are optional. Functions and#NEWLINE#variables statements can be shorten to funcs and vars.#NEWLINE#"},
|
||||
{6, symcomplex, "Expressions with complex numbers are written using an i to denote#NEWLINE#the imaginary value. Complex numbers can seamlessly be mixed with#NEWLINE#real numbers.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: 2+3i#NEWLINE#Example: 2+3.2i*cos(-1i)+5/7#NEWLINE#"},
|
||||
{7, symclear, "The clear statement erases all text in the console window.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: clear#NEWLINE#"},
|
||||
{8, symdef, "The def statement is used to define functions. When defining a function#NEWLINE#it is possible to omit the def keyword. Defined functions can be shown#NEWLINE#using the functions statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: def f(x)=2*x+3#NEWLINE#Optional syntax: f(x)=2*x+3#NEWLINE#"},
|
||||
{9, symdelete, "The delete statement can delete variable and functions. To delete a#NEWLINE#single variable or functions use the name of the function or variable.#NEWLINE#To delete all functions or variables specify either the variable or#NEWLINE#function keyword.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: delete f(x)#NEWLINE#Syntax: delete variables#NEWLINE#"},
|
||||
{10, symdigits, "The digits statement defines the displayed number of significant digits.#NEWLINE#To show current configuration use the digits statement without specifying#NEWLINE#the number.#NEWLINE# #SYNTAXHIGHLIGHT#Syntax: digits 7#NEWLINE#"},
|
||||
{11, symeval, "The eval statement evaluates an expression. When evaluating an expression#NEWLINE#it is possible to omit the eval keyword.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: eval 2.4*x+3.2#NEWLINE#Optional syntax: 2.4*x+3.2#NEWLINE#"},
|
||||
{12, symexecute, "The execute statement reads the content of a file and execute all statements.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: execute \"savedfile\"#NEWLINE#"},
|
||||
{13, syminput, "The input statement either changes or shows the how numeral input is interpreted.#NEWLINE#Possible input systems are: binary, octal, decimal and hexadecimal. Default is#NEWLINE#decimal. To use positional systems with other bases specify the base number.#NEWLINE#Numeral output system can be modified using the output statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: input hexadecimal#NEWLINE#Syntax: input 4#NEWLINE#"},
|
||||
{14, symhelp, "The help statement can be used to display help about topics and statements.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: help variables#NEWLINE#"},
|
||||
{15, symoutput, "The output statement either changes or shows the how numeral output is shown.#NEWLINE#Possible output systems are: binary, octal, decimal and hexadecimal. Default#NEWLINE#is decimal. To use positional systems with other bases specify the base number.#NEWLINE#Numeral input system can be modified using the input statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: output octal#NEWLINE#"},
|
||||
{16, symlist, "No description is available for the list statement.#NEWLINE#"},
|
||||
{17, symshow, "The show statement displays the content of a file.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: show \"filetosee\"#NEWLINE#"},
|
||||
{18, symload, "The load statement retrieves a set of defined variables and functions from#NEWLINE#a file. Variables and functions can be saved using the save statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: load \"savedwork\"#NEWLINE#"},
|
||||
{19, symsave, "The save statement saves defined variables and functions to a file in a#NEWLINE#plain text format. Saved variables and functions can be retrieved using#NEWLINE#the load statement.#NEWLINE# #SYNTAXHIGHLIGHT#Syntax: save \"worktokeep\"#NEWLINE#"},
|
||||
{20, symversion, "Show which version of amath is running.#NEWLINE#"},
|
||||
{21, symmem, "Show internal memory usage together with maximum usage.#NEWLINE#"},
|
||||
{22, symprefs, "There is no help for prefs statement now.#NEWLINE#"},
|
||||
{23, symvariable, "The variable statement shows a list of variables in memory.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: variables#NEWLINE##NORMALTEXT#optional syntax: vars#NEWLINE#"},
|
||||
{24, symexit, "The exit statement shuts down amath.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: exit#NEWLINE#"},
|
||||
{25, syme, "Euler's number is base of the exponential function which equals its own#NEWLINE#derivative. It is approximately equal to 2.71828.#NEWLINE##SYNTAXHIGHLIGHT#Example: ln(e)#NEWLINE#"},
|
||||
{26, sympi, "Pi is the ratio of the circumference of a circle to its diameter. Being an#NEWLINE#irrational number, pi cannot be expressed exactly as a common fraction.#NEWLINE#The value of pi is commonly approximated as #SYNTAXHIGHLIGHT#3.14159#NORMALTEXT#.#NEWLINE#"},
|
||||
{27, symi, "The imaginary unit is denoted and commonly referred to as i.#NEWLINE#The imaginary unit is a number, which when multiplied#NEWLINE#by itself gives -1.#NEWLINE#"},
|
||||
{28, symins, "No help is available for the ins variable#NEWLINE#"},
|
||||
{29, symbin, "No help is available for the binary keyword#NEWLINE"},
|
||||
{30, symoct, "No help is available for the octal keyword#NEWLINE"},
|
||||
{31, symdec, "No help is available for the decimal keyword#NEWLINE"},
|
||||
{32, symhex, "No help is available for the hexadecimal keyword#NEWLINE"},
|
||||
{-1, symzero, EMPTYSTRING}
|
||||
{ 0, symzero, "Enter command or expression to evaluate.#NEWLINE##SYNTAXHIGHLIGHT#Example: 2+3-cos(3)#NORMALTEXT##NEWLINE# #NEWLINE#More help is available for designated topics.#NEWLINE#-------------------------------------------------#NEWLINE#functions Base functions.#NEWLINE#trigon Trigonometric functions.#NEWLINE#hyper Hyperbolic functions.#NEWLINE#early Early trigonometric functions.#NEWLINE#complex Syntax for complex numbers.#NEWLINE#statements Available statements.#NEWLINE#operators Supported operators.#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: help trigon#NEWLINE#" },
|
||||
{ 1, symoperator, "-------------------------------------------------#NEWLINE# + Mathematical addition.#NEWLINE# - Mathematical subtraction.#NEWLINE# * Mathematical multiplication.#NEWLINE# / Mathematical division.#NEWLINE# ^ Mathematical exponentiation.#NEWLINE# = Assignment of variable values.#NEWLINE# | Absolute value of number. #NEWLINE#-------------------------------------------------#NEWLINE#" },
|
||||
{ 2, symfunction, "-------------------------------------------------#NEWLINE#abs Absolute value of number.#NEWLINE#sgn Mathematical signum function.#NEWLINE#round Round to nearest integer number.#NEWLINE#trunc Discard fraction part of number.#NEWLINE#floor Mathematical floor function.#NEWLINE#ceil Mathematical ceiling function.#NEWLINE#sqrt Square root function (exp 1/2).#NEWLINE#cbrt Cube root function (exp 1/3).#NEWLINE#lb Binary logarithm function (base 2).#NEWLINE#ln Natural logarithm function (base e).#NEWLINE#lg Common logarithm function (base 10).#NEWLINE#-------------------------------------------------#NEWLINE##SYNTAXHIGHLIGHT#Example: round(1.55)#NORMALTEXT##NEWLINE#" },
|
||||
{ 3, symtrigon, "-------------------------------------------------#NEWLINE#sin Trigonometric sine function.#NEWLINE#cos Trigonometric cosine function.#NEWLINE#tan Trigonometric tangent function.#NEWLINE#cot Trigonometric cotangent function.#NEWLINE#sec Trigonometric secant function.#NEWLINE#csc Trigonometric cosecant function.#NEWLINE#exsec Trigonometric exsecant function.#NEWLINE#excsc Trigonometric excosecant function.#NEWLINE#asin Inverse trigonometric sine function.#NEWLINE#acos Inverse trigonometric cosine function.#NEWLINE#atan Inverse trigonometric tangent function.#NEWLINE#acot Inverse trigonometric cotangent function.#NEWLINE#asec Inverse trigonometric secant function.#NEWLINE#acsc Inverse trigonometric cosecant function.#NEWLINE#exsec Inverse trigonometric exsecant function.#NEWLINE#excsc Inverse trigonometric excosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#" },
|
||||
{ 4, symhyper, "-------------------------------------------------#NEWLINE#sinh Hyperbolic sine function.#NEWLINE#cosh Hyperbolic cosine function.#NEWLINE#tanh Hyperbolic tangent function.#NEWLINE#coth Hyperbolic cotangent function.#NEWLINE#sech Hyperbolic secant function.#NEWLINE#csch Hyperbolic cosecant function. #NEWLINE#asinh Inverse hyperbolic sine function.#NEWLINE#acosh Inverse hyperbolic cosine function.#NEWLINE#atanh Inverse hyperbolic tangent function.#NEWLINE#acoth Inverse hyperbolic cotangent function.#NEWLINE#asech Inverse hyperbolic secant function.#NEWLINE#acsch Inverse hyperbolic cosecant function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#" },
|
||||
{ 5, symearly, "-------------------------------------------------#NEWLINE#ver Versed sine function.#NEWLINE#vcs Versed cosine function.#NEWLINE#cvs Coversed sine function.#NEWLINE#cvc Coversed cosine function.#NEWLINE#hv Haversed sine function.#NEWLINE#hvc Haversed cosine function.#NEWLINE#hcv Hacoversed sine function.#NEWLINE#hcc Hacoversed cosine function.#NEWLINE#aver Inverse versed sine function.#NEWLINE#avcs Inverse versed cosine function.#NEWLINE#acvs Inverse coversed sine function.#NEWLINE#acvc Inverse coversed cosine function.#NEWLINE#ahv Inverse haversed sine function.#NEWLINE#ahvc Inverse haversed cosine function.#NEWLINE#ahcv Inverse hacoversed sine function.#NEWLINE#ahcc Inverse hacoversed cosine function.#NEWLINE#-------------------------------------------------#NEWLINE#Inverse functions can be prefixed with ar or arc #NEWLINE#instead of a.#NEWLINE#" },
|
||||
{ 6, symcomplex, "Expressions with complex numbers are written using an i to denote#NEWLINE#the imaginary value. Complex numbers can seamlessly be mixed with#NEWLINE#real numbers.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: 2+3i#NEWLINE#Example: 2+3.2i*cos(-1i)+5/7#NEWLINE#" },
|
||||
{ 7, symclear, "The clear statement erases all text in the console window.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: clear#NEWLINE#" },
|
||||
{ 8, symdef, "The def statement is used to define functions. When defining a function#NEWLINE#it is possible to omit the def keyword. Defined functions can be shown#NEWLINE#using the functions statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: def f(x)=2*x+3#NEWLINE#Optional syntax: f(x)=2*x+3#NEWLINE#" },
|
||||
{ 9, symdelete, "The delete statement can delete variable and functions. To delete a#NEWLINE#single variable or functions use the name of the function or variable.#NEWLINE#To delete all functions or variables specify either the variable or#NEWLINE#function keyword.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: delete f(x)#NEWLINE#Syntax: delete variables#NEWLINE#" },
|
||||
{ 10, symdigits, "The digits statement defines the displayed number of significant digits.#NEWLINE#To show current configuration use the digits statement without specifying#NEWLINE#the number.#NEWLINE# #SYNTAXHIGHLIGHT#Syntax: digits 7#NEWLINE#" },
|
||||
{ 11, symeval, "The eval statement evaluates an expression. When evaluating an expression#NEWLINE#it is possible to omit the eval keyword.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: eval 2.4*x+3.2#NEWLINE#Optional syntax: 2.4*x+3.2#NEWLINE#" },
|
||||
{ 12, symexecute, "The execute statement reads the content of a file and execute all statements.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: execute \"savedfile\"#NEWLINE#" },
|
||||
{ 13, syminput, "The input statement either changes or shows the how numeral input is interpreted.#NEWLINE#Possible input systems are: binary, octal, decimal and hexadecimal. Default is#NEWLINE#decimal. To use positional systems with other bases specify the base number.#NEWLINE#Numeral output system can be modified using the output statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: input hexadecimal#NEWLINE#Syntax: input 4#NEWLINE#" },
|
||||
{ 14, symhelp, "The help statement can be used to display help about topics and statements.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: help variables#NEWLINE#" },
|
||||
{ 15, symoutput, "The output statement either changes or shows the how numeral output is shown.#NEWLINE#Possible output systems are: binary, octal, decimal and hexadecimal. Default#NEWLINE#is decimal. To use positional systems with other bases specify the base number.#NEWLINE#Numeral input system can be modified using the input statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: output octal#NEWLINE#" },
|
||||
{ 16, symlist, "No description is available for the list statement.#NEWLINE#" },
|
||||
{ 17, symshow, "The show statement displays the content of a file.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: show \"filetosee\"#NEWLINE#" },
|
||||
{ 18, symload, "The load statement retrieves a set of defined variables and functions from#NEWLINE#a file. Variables and functions can be saved using the save statement.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: load \"savedwork\"#NEWLINE#" },
|
||||
{ 19, symsave, "The save statement saves defined variables and functions to a file in a#NEWLINE#plain text format. Saved variables and functions can be retrieved using#NEWLINE#the load statement.#NEWLINE# #SYNTAXHIGHLIGHT#Syntax: save \"worktokeep\"#NEWLINE#" },
|
||||
{ 20, symversion, "Show which version of amath is running.#NEWLINE#" },
|
||||
{ 21, symabout, "Show various information about the running version of amath.#NEWLINE#" },
|
||||
{ 22, symlicense, "Show license details.#NEWLINE#" },
|
||||
{ 23, symmem, "Show internal memory usage together with maximum usage.#NEWLINE#" },
|
||||
{ 24, symprefs, "There is no help for prefs statement now.#NEWLINE#" },
|
||||
{ 25, symvariable, "The variable statement shows a list of variables in memory.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: variables#NEWLINE##NORMALTEXT#optional syntax: vars#NEWLINE#" },
|
||||
{ 26, symexit, "The exit statement shuts down amath.#NEWLINE##SYNTAXHIGHLIGHT#Syntax: exit#NEWLINE#" },
|
||||
{ 27, syme, "Euler's number is base of the exponential function which equals its own#NEWLINE#derivative. It is approximately equal to 2.71828.#NEWLINE##SYNTAXHIGHLIGHT#Example: ln(e)#NEWLINE#" },
|
||||
{ 28, sympi, "Pi is the ratio of the circumference of a circle to its diameter. Being an#NEWLINE#irrational number, pi cannot be expressed exactly as a common fraction.#NEWLINE#The value of pi is commonly approximated as #SYNTAXHIGHLIGHT#3.14159#NORMALTEXT#.#NEWLINE#" },
|
||||
{ 29, symi, "The imaginary unit is denoted and commonly referred to as i.#NEWLINE#The imaginary unit is a number, which when multiplied#NEWLINE#by itself gives -1.#NEWLINE#" },
|
||||
{ 30, symins, "No help is available for the ins variable#NEWLINE#" },
|
||||
{ 31, symbin, "No help is available for the binary keyword#NEWLINE" },
|
||||
{ 32, symoct, "No help is available for the octal keyword#NEWLINE" },
|
||||
{ 33, symdec, "No help is available for the decimal keyword#NEWLINE" },
|
||||
{ 34, symhex, "No help is available for the hexadecimal keyword#NEWLINE" },
|
||||
{ -1, symzero, EMPTYSTRING }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include "amatht.h"
|
||||
|
||||
static const identalias identaliases[] = {
|
||||
{"squareroot", "sqrt"},
|
||||
{"sqr", "sqrt"},
|
||||
{"cuberoot", "cbrt"},
|
||||
{"cbr", "cbrt"},
|
||||
{"log2", "lb"},
|
||||
{"log", "lg"},
|
||||
|
@ -41,6 +43,18 @@ static const identalias identaliases[] = {
|
|||
{"sine", "sin"},
|
||||
{"cosine", "cos"},
|
||||
{"tangent", "tan"},
|
||||
{"secant", "sec"},
|
||||
{"cosec", "csc"},
|
||||
{"cosecant", "csc"},
|
||||
{"ctg", "cot"},
|
||||
{"ctn", "cot"},
|
||||
{"cotangent", "cot"},
|
||||
{"arcsine", "asin"},
|
||||
{"arccosine", "acos"},
|
||||
{"arctangent", "atan"},
|
||||
{"arccotangent", "acot"},
|
||||
{"arcsecant", "asec"},
|
||||
{"arccosecant", "acsc"},
|
||||
{"arsin", "asin"},
|
||||
{"arcos", "acos"},
|
||||
{"artan", "atan"},
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define AMATH_LOCALIZE_IDENT_H
|
||||
|
||||
/**
|
||||
* @file ident.h
|
||||
* @file localize/ident.h
|
||||
* @brief Help texts for built-in functions.
|
||||
*
|
||||
*/
|
||||
|
@ -44,42 +44,62 @@
|
|||
#include "amatht.h"
|
||||
|
||||
static const identhelpdef identtexts[] = {
|
||||
{0, "abs", "No help is available for this function.#NEWLINE#"},
|
||||
{1, "sgn", "No help is available for this function.#NEWLINE#"},
|
||||
{2, "round", "No help is available for this function.#NEWLINE#"},
|
||||
{3, "trunc", "No help is available for this function.#NEWLINE#"},
|
||||
{4, "floor", "No help is available for this function.#NEWLINE#"},
|
||||
{5, "ceil", "No help is available for this function.#NEWLINE#"},
|
||||
{6, "sqr", "No help is available for this function.#NEWLINE#"},
|
||||
{7, "cbr", "No help is available for this function.#NEWLINE#"},
|
||||
{8, "lb", "No help is available for this function.#NEWLINE#"},
|
||||
{9, "ln", "No help is available for this function.#NEWLINE#"},
|
||||
{10, "lg", "No help is available for this function.#NEWLINE#"},
|
||||
{11, "sin", "No help is available for this function.#NEWLINE#"},
|
||||
{12, "cos", "No help is available for this function.#NEWLINE#"},
|
||||
{13, "tan", "No help is available for this function.#NEWLINE#"},
|
||||
{14, "cot", "No help is available for this function.#NEWLINE#"},
|
||||
{15, "sec", "No help is available for this function.#NEWLINE#"},
|
||||
{16, "csc", "No help is available for this function.#NEWLINE#"},
|
||||
{17, "asin", "No help is available for this function.#NEWLINE#"},
|
||||
{18, "acos", "No help is available for this function.#NEWLINE#"},
|
||||
{19, "atan", "No help is available for this function.#NEWLINE#"},
|
||||
{20, "acot", "No help is available for this function.#NEWLINE#"},
|
||||
{21, "asec", "No help is available for this function.#NEWLINE#"},
|
||||
{22, "acsc", "No help is available for this function.#NEWLINE#"},
|
||||
{23, "sinh", "No help is available for this function.#NEWLINE#"},
|
||||
{24, "cosh", "No help is available for this function.#NEWLINE#"},
|
||||
{25, "tanh", "No help is available for this function.#NEWLINE#"},
|
||||
{26, "coth", "No help is available for this function.#NEWLINE#"},
|
||||
{27, "sech", "No help is available for this function.#NEWLINE#"},
|
||||
{28, "csch", "No help is available for this function.#NEWLINE#"},
|
||||
{29, "asinh", "No help is available for this function.#NEWLINE#"},
|
||||
{30, "acosh", "No help is available for this function.#NEWLINE#"},
|
||||
{31, "atanh", "No help is available for this function.#NEWLINE#"},
|
||||
{32, "acoth", "No help is available for this function.#NEWLINE#"},
|
||||
{33, "asech", "No help is available for this function.#NEWLINE#"},
|
||||
{34, "acsch", "No help is available for this function.#NEWLINE#"},
|
||||
{-1, EMPTYSTRING, EMPTYSTRING}
|
||||
{ 0, "abs", "No help is available for this function.#NEWLINE#" },
|
||||
{ 1, "sgn", "No help is available for this function.#NEWLINE#" },
|
||||
{ 2, "round", "No help is available for this function.#NEWLINE#" },
|
||||
{ 3, "trunc", "No help is available for this function.#NEWLINE#" },
|
||||
{ 4, "floor", "No help is available for this function.#NEWLINE#" },
|
||||
{ 5, "ceil", "No help is available for this function.#NEWLINE#" },
|
||||
{ 6, "sqr", "No help is available for this function.#NEWLINE#" },
|
||||
{ 7, "cbr", "No help is available for this function.#NEWLINE#" },
|
||||
{ 8, "lb", "No help is available for this function.#NEWLINE#" },
|
||||
{ 9, "ln", "No help is available for this function.#NEWLINE#" },
|
||||
{ 10, "lg", "No help is available for this function.#NEWLINE#" },
|
||||
{ 11, "sin", "No help is available for this function.#NEWLINE#" },
|
||||
{ 12, "cos", "No help is available for this function.#NEWLINE#" },
|
||||
{ 13, "tan", "No help is available for this function.#NEWLINE#" },
|
||||
{ 14, "cot", "No help is available for this function.#NEWLINE#" },
|
||||
{ 15, "sec", "No help is available for this function.#NEWLINE#" },
|
||||
{ 16, "csc", "No help is available for this function.#NEWLINE#" },
|
||||
{ 17, "asin", "No help is available for this function.#NEWLINE#" },
|
||||
{ 18, "acos", "No help is available for this function.#NEWLINE#" },
|
||||
{ 19, "atan", "No help is available for this function.#NEWLINE#" },
|
||||
{ 20, "acot", "No help is available for this function.#NEWLINE#" },
|
||||
{ 21, "asec", "No help is available for this function.#NEWLINE#" },
|
||||
{ 22, "acsc", "No help is available for this function.#NEWLINE#" },
|
||||
{ 23, "sinh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 24, "cosh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 25, "tanh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 26, "coth", "No help is available for this function.#NEWLINE#" },
|
||||
{ 27, "sech", "No help is available for this function.#NEWLINE#" },
|
||||
{ 28, "csch", "No help is available for this function.#NEWLINE#" },
|
||||
{ 29, "asinh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 30, "acosh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 31, "atanh", "No help is available for this function.#NEWLINE#" },
|
||||
{ 32, "acoth", "No help is available for this function.#NEWLINE#" },
|
||||
{ 33, "asech", "No help is available for this function.#NEWLINE#" },
|
||||
{ 34, "acsch", "No help is available for this function.#NEWLINE#" },
|
||||
{ 35, "ver", "The versed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the cosine.#NEWLINE#ver(x) = 1 - cos(x)#NEWLINE#" },
|
||||
{ 36, "vcs", "The versed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the cosine.#NEWLINE#ver(x) = 1 + cos(x)#NEWLINE#" },
|
||||
{ 37, "cvs", "The coversed sine is an early appearing trigonometric function.#NEWLINE#It is equal to one minus the sine.#NEWLINE#ver(x) = 1 - sin(x)#NEWLINE#" },
|
||||
{ 38, "cvc", "The coversed cosine is an early appearing trigonometric function.#NEWLINE#It is equal to one plus the sine.#NEWLINE#cvc(x) = 1 + sin(x)#NEWLINE#" },
|
||||
{ 39, "hv", "No help is available for the haversed sine function.#NEWLINE#" },
|
||||
{ 40, "hvc", "No help is available for the haversed cosine function.#NEWLINE#" },
|
||||
{ 41, "hcv", "No help is available for the hacoversed sine function.#NEWLINE#" },
|
||||
{ 42, "hcc", "No help is available for the hacoversed cosine function.#NEWLINE#" },
|
||||
{ 43, "aver", "No help is available for this function.#NEWLINE#" },
|
||||
{ 44, "avcs", "No help is available for this function.#NEWLINE#" },
|
||||
{ 45, "acvs", "No help is available for this function.#NEWLINE#" },
|
||||
{ 46, "acvc", "No help is available for this function.#NEWLINE#" },
|
||||
{ 47, "ahv", "No help is available for this function.#NEWLINE#" },
|
||||
{ 48, "ahvc", "No help is available for this function.#NEWLINE#" },
|
||||
{ 49, "ahcv", "The inverse hacoversed sine is not implemented in this version of amath.#NEWLINE#" },
|
||||
{ 50, "ahcc", "The inverse hacoversed cosine is not implemented in this version of amath.#NEWLINE#" },
|
||||
{ 51, "exsec", "No help is available for the exsecant function.#NEWLINE#" },
|
||||
{ 52, "excsc", "No help is available for the excosecant function.#NEWLINE#" },
|
||||
{ 53, "aexsec", "No help is available for the inverse exsecant function.#NEWLINE#" },
|
||||
{ 54, "aexcsc", "No help is available for the inverse excosecant function.#NEWLINE#" },
|
||||
{ -1, EMPTYSTRING, EMPTYSTRING }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define AMATH_LOCALIZE_KEYWORD_H
|
||||
|
||||
/**
|
||||
* @file kword.h
|
||||
* @file localize/kword.h
|
||||
* @brief Keywords used by lexer.
|
||||
*
|
||||
*/
|
||||
|
@ -55,55 +55,56 @@ struct keyworddef
|
|||
};
|
||||
|
||||
static const keyworddef keywords[] = {
|
||||
{0, symclear, "clear"},
|
||||
{1, symdef, "def"},
|
||||
{2, symdelete, "delete"},
|
||||
{3, syme, "e"},
|
||||
{4, symi, "i"},
|
||||
{5, sympi, "pi"},
|
||||
{6, symins, "ins"},
|
||||
{7, symeval, "eval"},
|
||||
{8, symdraw, "draw"},
|
||||
{9, symplot, "plot"},
|
||||
{10, symexecute, "execute"},
|
||||
{11, symexit, "exit"},
|
||||
{12, symexit, "quit"},
|
||||
{13, symstatement, "statements"},
|
||||
{14, symoperator, "operators"},
|
||||
{15, symcomplex, "complex"},
|
||||
{16, symfunction, "funcs"},
|
||||
{17, symfunction, "functions"},
|
||||
{18, symtrigon, "trigon"},
|
||||
{19, symtrigon, "trigonometric"},
|
||||
{20, symhyper, "hyper"},
|
||||
{21, symhyper, "hyperbolic"},
|
||||
{22, symhelp, "help"},
|
||||
{23, symprompt, "prompt"},
|
||||
{24, symversion, "version"},
|
||||
{25, symmem, "mem"},
|
||||
{26, symmem, "memory"},
|
||||
{27, symprefs, "prefs"},
|
||||
{28, symprefs, "preferences"},
|
||||
{29, symlist, "list"},
|
||||
{30, symload, "load"},
|
||||
{31, symsave, "save"},
|
||||
{32, symshow, "show"},
|
||||
{33, symvariable, "vars"},
|
||||
{34, symvariable, "variables"},
|
||||
{35, symdigits, "digits"},
|
||||
{36, syminput, "input"},
|
||||
{37, symoutput, "output"},
|
||||
{38, symbin, "bin"},
|
||||
{39, symbin, "binary"},
|
||||
{40, symoct, "oct"},
|
||||
{41, symoct, "octal"},
|
||||
{42, symdec, "dec"},
|
||||
{43, symdec, "decimal"},
|
||||
{44, symhex, "hex"},
|
||||
{45, symhex, "hexadecimal"},
|
||||
{46, symabout, "about"},
|
||||
{47, symlicense, "license"},
|
||||
{-1, Symbol(0), EMPTYSTRING}
|
||||
{ 0, symclear, "clear" },
|
||||
{ 1, symdef, "def" },
|
||||
{ 2, symdelete, "delete" },
|
||||
{ 3, syme, "e" },
|
||||
{ 4, symi, "i" },
|
||||
{ 5, sympi, "pi" },
|
||||
{ 6, symins, "ins" },
|
||||
{ 7, symeval, "eval" },
|
||||
{ 8, symdraw, "draw" },
|
||||
{ 9, symplot, "plot" },
|
||||
{ 10, symexecute, "execute" },
|
||||
{ 11, symexit, "exit" },
|
||||
{ 12, symexit, "quit" },
|
||||
{ 13, symstatement, "statements" },
|
||||
{ 14, symoperator, "operators" },
|
||||
{ 15, symcomplex, "complex" },
|
||||
{ 16, symfunction, "funcs" },
|
||||
{ 17, symfunction, "functions" },
|
||||
{ 18, symtrigon, "trigon" },
|
||||
{ 19, symtrigon, "trigonometric" },
|
||||
{ 20, symhyper, "hyper" },
|
||||
{ 21, symhyper, "hyperbolic" },
|
||||
{ 22, symearly, "early" },
|
||||
{ 23, symhelp, "help" },
|
||||
{ 24, symprompt, "prompt" },
|
||||
{ 25, symversion, "version" },
|
||||
{ 26, symmem, "mem" },
|
||||
{ 27, symmem, "memory" },
|
||||
{ 28, symprefs, "prefs" },
|
||||
{ 29, symprefs, "preferences" },
|
||||
{ 30, symlist, "list" },
|
||||
{ 31, symload, "load" },
|
||||
{ 32, symsave, "save" },
|
||||
{ 33, symshow, "show" },
|
||||
{ 34, symvariable, "vars" },
|
||||
{ 35, symvariable, "variables" },
|
||||
{ 36, symdigits, "digits" },
|
||||
{ 37, syminput, "input" },
|
||||
{ 38, symoutput, "output" },
|
||||
{ 39, symbin, "bin" },
|
||||
{ 40, symbin, "binary" },
|
||||
{ 41, symoct, "oct" },
|
||||
{ 42, symoct, "octal" },
|
||||
{ 43, symdec, "dec" },
|
||||
{ 44, symdec, "decimal" },
|
||||
{ 45, symhex, "hex" },
|
||||
{ 46, symhex, "hexadecimal" },
|
||||
{ 47, symabout, "about" },
|
||||
{ 48, symlicense, "license" },
|
||||
{ -1, Symbol(0), EMPTYSTRING }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define AMATH_LOCALIZE_LEX_H
|
||||
|
||||
/**
|
||||
* @file lex.h
|
||||
* @file localize/lex.h
|
||||
* @brief Lexer defitions used by other classes.
|
||||
*
|
||||
*/
|
||||
|
@ -73,6 +73,7 @@ typedef enum
|
|||
symvariable,
|
||||
symtrigon,
|
||||
symhyper,
|
||||
symearly,
|
||||
symcomplex,
|
||||
syme,
|
||||
sympi,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define AMATH_LOCALIZE_TEXT_H
|
||||
|
||||
/**
|
||||
* @file text.h
|
||||
* @file localize/text.h
|
||||
* @brief Static texts in amath.
|
||||
*
|
||||
*/
|
||||
|
@ -45,77 +45,117 @@
|
|||
#include "amatht.h"
|
||||
#include "system/program.h"
|
||||
|
||||
#define INTROMSG Program->Language->GetText(0)
|
||||
#define TXTLISTDIRHEADER Program->Language->GetText(1)
|
||||
#define TXTLISTDIRTFILE Program->Language->GetText(2)
|
||||
#define TXTLISTDIRTDIR Program->Language->GetText(3)
|
||||
#define TXTLISTDIRTUNKNOWN Program->Language->GetText(4)
|
||||
#define TXTMEMBLOCKS Program->Language->GetText(5)
|
||||
#define TXTMEMSIZE Program->Language->GetText(6)
|
||||
#define TXTMEMMAXSIZE Program->Language->GetText(7)
|
||||
#define HELPNOHELP Program->Language->GetText(8)
|
||||
#define HELPSYNTAX Program->Language->GetText(9)
|
||||
#define HELPUERROR Program->Language->GetText(10)
|
||||
#define HELPVARNDEF Program->Language->GetText(11)
|
||||
#define HELPFUNNDEF Program->Language->GetText(12)
|
||||
#define HELPFUNRDEF Program->Language->GetText(13)
|
||||
#define HELPPNUMERA Program->Language->GetText(14)
|
||||
#define HELPPDIGITS Program->Language->GetText(15)
|
||||
#define HELPINPUSHOW Program->Language->GetText(16)
|
||||
#define HELPOUTPSHOW Program->Language->GetText(17)
|
||||
#define HELPINPUSETT Program->Language->GetText(18)
|
||||
#define HELPOUTPSETT Program->Language->GetText(19)
|
||||
#define HELPDIGISETT Program->Language->GetText(20)
|
||||
#define HELPDIGISHOW Program->Language->GetText(21)
|
||||
#define HELPVARSNDEF Program->Language->GetText(22)
|
||||
#define HELPFUNCNDEF Program->Language->GetText(23)
|
||||
#define HELPLOADSUCC Program->Language->GetText(24)
|
||||
#define HELPSAVESUCC Program->Language->GetText(25)
|
||||
#define HELPSAVEFAIL Program->Language->GetText(26)
|
||||
#define HELPSAVENOTH Program->Language->GetText(27)
|
||||
#define HELPPREFLOAD Program->Language->GetText(28)
|
||||
#define HELPPREFNOLO Program->Language->GetText(29)
|
||||
#define HELPPREFSAVE Program->Language->GetText(30)
|
||||
#define HELPPREFNOSA Program->Language->GetText(31)
|
||||
#define MSGNODIR Program->Language->GetText(32)
|
||||
#define MSGNOFILE Program->Language->GetText(33)
|
||||
#define INTROMSG (Program->Language->GetText(0))
|
||||
#define STATEMENTLINE (Program->Language->GetText(1))
|
||||
#define STATEMENTCLEAR (Program->Language->GetText(2))
|
||||
#define STATEMENTDEF (Program->Language->GetText(3))
|
||||
#define STATEMENTDELETE (Program->Language->GetText(4))
|
||||
#define STATEMENTDIGITS (Program->Language->GetText(5))
|
||||
#define STATEMENTEVAL (Program->Language->GetText(6))
|
||||
#define STATEMENTEXECUTE (Program->Language->GetText(7))
|
||||
#define STATEMENTFUNCS (Program->Language->GetText(8))
|
||||
#define STATEMENTINPUT (Program->Language->GetText(9))
|
||||
#define STATEMENTHELP (Program->Language->GetText(10))
|
||||
#define STATEMENTOUTPUT (Program->Language->GetText(11))
|
||||
#define STATEMENTLIST (Program->Language->GetText(12))
|
||||
#define STATEMENTSHOW (Program->Language->GetText(13))
|
||||
#define STATEMENTLOAD (Program->Language->GetText(14))
|
||||
#define STATEMENTSAVE (Program->Language->GetText(15))
|
||||
#define STATEMENTVARS (Program->Language->GetText(16))
|
||||
#define STATEMENTVERSION (Program->Language->GetText(17))
|
||||
#define STATEMENTMEMORY (Program->Language->GetText(18))
|
||||
#define STATEMENTEXIT (Program->Language->GetText(19))
|
||||
#define STATEMENTFOOTER (Program->Language->GetText(20))
|
||||
#define TXTLISTDIRHEADER (Program->Language->GetText(21))
|
||||
#define TXTLISTDIRTFILE (Program->Language->GetText(22))
|
||||
#define TXTLISTDIRTDIR (Program->Language->GetText(23))
|
||||
#define TXTLISTDIRTUNKNOWN (Program->Language->GetText(24))
|
||||
#define TXTMEMBLOCKS (Program->Language->GetText(25))
|
||||
#define TXTMEMSIZE (Program->Language->GetText(26))
|
||||
#define TXTMEMMAXSIZE (Program->Language->GetText(27))
|
||||
#define HELPNOHELP (Program->Language->GetText(28))
|
||||
#define HELPSYNTAX (Program->Language->GetText(29))
|
||||
#define HELPUERROR (Program->Language->GetText(30))
|
||||
#define HELPVARNDEF (Program->Language->GetText(31))
|
||||
#define HELPFUNNDEF (Program->Language->GetText(32))
|
||||
#define HELPFUNRDEF (Program->Language->GetText(33))
|
||||
#define HELPPNUMERA (Program->Language->GetText(34))
|
||||
#define HELPPDIGITS (Program->Language->GetText(35))
|
||||
#define HELPINPUSHOW (Program->Language->GetText(36))
|
||||
#define HELPOUTPSHOW (Program->Language->GetText(37))
|
||||
#define HELPINPUSETT (Program->Language->GetText(38))
|
||||
#define HELPOUTPSETT (Program->Language->GetText(39))
|
||||
#define HELPDIGISETT (Program->Language->GetText(40))
|
||||
#define HELPDIGISHOW (Program->Language->GetText(41))
|
||||
#define HELPVARSNDEF (Program->Language->GetText(42))
|
||||
#define HELPFUNCNDEF (Program->Language->GetText(43))
|
||||
#define HELPLOADSUCC (Program->Language->GetText(44))
|
||||
#define HELPSAVESUCC (Program->Language->GetText(45))
|
||||
#define HELPSAVEFAIL (Program->Language->GetText(46))
|
||||
#define HELPSAVENOTH (Program->Language->GetText(47))
|
||||
#define HELPPREFLOAD (Program->Language->GetText(48))
|
||||
#define HELPPREFNOLO (Program->Language->GetText(49))
|
||||
#define HELPPREFSAVE (Program->Language->GetText(50))
|
||||
#define HELPPREFNOSA (Program->Language->GetText(51))
|
||||
#define MSGNODIR (Program->Language->GetText(52))
|
||||
#define MSGNOFILE (Program->Language->GetText(53))
|
||||
|
||||
static const textdef textdefs[] = {
|
||||
{0, "#NORMALTEXT##BOLD##STARTMSG##NEWLINE##NORMALTEXT##COLOR02#Type help to show info.#NEWLINE#"}, /* INTROMSG */
|
||||
{1, "Type Name#NEWLINE#-----------------------------------------------#NEWLINE#"}, /* TXTLISTDIRHEADER */
|
||||
{2, "[file]"}, /* TXTLISTDIRTFILE */
|
||||
{3, "[dir]"}, /* TXTLISTDIRTDIR */
|
||||
{4, "[unknown]"}, /* TXTLISTDIRTUNKNOWN */
|
||||
{5, "Allocated blocks:#SPACE#"}, /* TXTMEMBLOCKS */
|
||||
{6, "Memory usage: #SPACE#"}, /* TXTMEMSIZE */
|
||||
{7, "Maximum usage: #SPACE#"}, /* TXTMEMMAXSIZE */
|
||||
{8, "No help is available for this topic.#NEWLINE#"}, /* HELPNOHELP */
|
||||
{9, "Syntax error:#SPACE#"}, /* HELPSYNTAX */
|
||||
{10, "Unexpected error:#SPACE#"}, /* HELPUERROR */
|
||||
{11, "Variable is not defined:#SPACE#"}, /* HELPVARNDEF */
|
||||
{12, "Function is not defined:#SPACE#"}, /* HELPFUNNDEF */
|
||||
{13, "Function cannot be redefined:#SPACE#"}, /* HELPFUNRDEF */
|
||||
{14, "Base value must be between 2 and 32:#SPACE#"}, /* HELPPNUMERA */
|
||||
{15, "Number of digist must be between 0 and 15:#SPACE#"}, /* HELPPDIGITS */
|
||||
{16, "Numeral input system is#SPACE#"}, /* HELPINPUSHOW */
|
||||
{17, "Numeral output system is#SPACE#"}, /* HELPOUTPSHOW */
|
||||
{18, "Input changed to#SPACE#"}, /* HELPINPUSETT */
|
||||
{19, "Output changed to#SPACE#"}, /* HELPOUTPSETT */
|
||||
{20, "Number of digits changed to#SPACE#"}, /* HELPDIGISETT */
|
||||
{21, "Number of digits shown are#SPACE#"}, /* HELPDIGISHOW */
|
||||
{22, "No variables are defined.#NEWLINE#"}, /* HELPVARSNDEF */
|
||||
{23, "No functions are defined.#NEWLINE#"}, /* HELPFUNCNDEF */
|
||||
{24, "Variable and functions loaded from file.#NEWLINE#"}, /* HELPLOADSUCC */
|
||||
{25, "Variable and functions saved to file.#NEWLINE#"}, /* HELPSAVESUCC */
|
||||
{26, "Cannot save to file.#NEWLINE#"}, /* HELPSAVEFAIL */
|
||||
{27, "Nothing to save.#NEWLINE#"}, /* HELPSAVENOTH */
|
||||
{28, "Preferences loaded.#NEWLINE#"}, /* HELPPREFLOAD */
|
||||
{29, "Preferences could not be loaded.#NEWLINE#"}, /* HELPPREFNOLO */
|
||||
{30, "Preferences saved to disk.#NEWLINE#"}, /* HELPPREFSAVE */
|
||||
{31, "Preferences could not be saved.#NEWLINE#"}, /* HELPPREFNOSA */
|
||||
{32, "Could not open directory:#SPACE#"}, /* MSGNODIR */
|
||||
{33, "Cannot open file.#NEWLINE#"}, /* MSGNOFILE */
|
||||
{-1, EMPTYSTRING}
|
||||
{ 0, "#NORMALTEXT##BOLD##STARTMSG##NEWLINE##NORMALTEXT##COLOR02#Type help to show info.#NEWLINE#" }, /* INTROMSG */
|
||||
{ 1, "---------------------------------------------------------#NEWLINE#" }, /* STATEMENTLINE */
|
||||
{ 2, "clear Clear console window.#NEWLINE#" }, /* STATEMENTCLEAR */
|
||||
{ 3, "def Define function.#NEWLINE#" }, /* STATEMENTDEF */
|
||||
{ 4, "delete Delete variable or function.#NEWLINE#" }, /* STATEMENTDELETE */
|
||||
{ 5, "digits Set number of significant digits.#NEWLINE#" }, /* STATEMENTDIGITS */
|
||||
{ 6, "eval Evaluate arithmetic expression.#NEWLINE#" }, /* STATEMENTEVAL */
|
||||
{ 7, "execute Execute statements in a file.#NEWLINE#" }, /* STATEMENTEXECUTE */
|
||||
{ 8, "functions Show list of user defined functions.#NEWLINE#" }, /* STATEMENTFUNCS */
|
||||
{ 9, "input Change numeral input system.#NEWLINE#" }, /* STATEMENTINPUT */
|
||||
{ 10, "help Show basic help text.#NEWLINE#" }, /* STATEMENTHELP */
|
||||
{ 11, "output Change numeral output system.#NEWLINE#" }, /* STATEMENTOUTPUT */
|
||||
{ 12, "list Show content of a directory.#NEWLINE#" }, /* STATEMENTLIST */
|
||||
{ 13, "show Show content of a file.#NEWLINE#" }, /* STATEMENTSHOW */
|
||||
{ 14, "load Load variable and functions from file.#NEWLINE#" }, /* STATEMENTLOAD */
|
||||
{ 15, "save Save variable and functions to file.#NEWLINE#" }, /* STATEMENTSAVE */
|
||||
{ 16, "variables Show list of variables.#NEWLINE#" }, /* STATEMENTVARS */
|
||||
{ 17, "version Show version string.#NEWLINE#" }, /* STATEMENTVERSION */
|
||||
{ 18, "memory Show internal memory usage.#NEWLINE#" }, /* STATEMENTMEMORY */
|
||||
{ 19, "exit Exit program.#NEWLINE#" }, /* STATEMENTEXIT */
|
||||
{ 20, "The def and eval statements are optional. Functions and#NEWLINE#variables statements can be shorten to funcs and vars.#NEWLINE#" }, /* STATEMENTFOOTER */
|
||||
{ 21, "Type Name#NEWLINE#-----------------------------------------------#NEWLINE#" }, /* TXTLISTDIRHEADER */
|
||||
{ 22, "[file]" }, /* TXTLISTDIRTFILE */
|
||||
{ 23, "[dir]" }, /* TXTLISTDIRTDIR */
|
||||
{ 24, "[unknown]" }, /* TXTLISTDIRTUNKNOWN */
|
||||
{ 25, "Allocated blocks:#SPACE#" }, /* TXTMEMBLOCKS */
|
||||
{ 26, "Memory usage: #SPACE#" }, /* TXTMEMSIZE */
|
||||
{ 27, "Maximum usage: #SPACE#" }, /* TXTMEMMAXSIZE */
|
||||
{ 28, "No help is available for this topic.#NEWLINE#" }, /* HELPNOHELP */
|
||||
{ 29, "Syntax error:#SPACE#" }, /* HELPSYNTAX */
|
||||
{ 30, "Unexpected error:#SPACE#" }, /* HELPUERROR */
|
||||
{ 31, "Variable is not defined:#SPACE#" }, /* HELPVARNDEF */
|
||||
{ 32, "Function is not defined:#SPACE#" }, /* HELPFUNNDEF */
|
||||
{ 33, "Function cannot be redefined:#SPACE#" }, /* HELPFUNRDEF */
|
||||
{ 34, "Base value must be between 2 and 32:#SPACE#" }, /* HELPPNUMERA */
|
||||
{ 35, "Number of digist must be between 0 and 15:#SPACE#" }, /* HELPPDIGITS */
|
||||
{ 36, "Numeral input system is#SPACE#" }, /* HELPINPUSHOW */
|
||||
{ 37, "Numeral output system is#SPACE#" }, /* HELPOUTPSHOW */
|
||||
{ 38, "Input changed to#SPACE#" }, /* HELPINPUSETT */
|
||||
{ 39, "Output changed to#SPACE#" }, /* HELPOUTPSETT */
|
||||
{ 40, "Number of digits changed to#SPACE#" }, /* HELPDIGISETT */
|
||||
{ 41, "Number of digits shown are#SPACE#" }, /* HELPDIGISHOW */
|
||||
{ 42, "No variables are defined.#NEWLINE#" }, /* HELPVARSNDEF */
|
||||
{ 43, "No functions are defined.#NEWLINE#" }, /* HELPFUNCNDEF */
|
||||
{ 44, "Variable and functions loaded from file.#NEWLINE#" }, /* HELPLOADSUCC */
|
||||
{ 45, "Variable and functions saved to file.#NEWLINE#" }, /* HELPSAVESUCC */
|
||||
{ 46, "Cannot save to file.#NEWLINE#" }, /* HELPSAVEFAIL */
|
||||
{ 47, "Nothing to save.#NEWLINE#" }, /* HELPSAVENOTH */
|
||||
{ 48, "Preferences loaded.#NEWLINE#" }, /* HELPPREFLOAD */
|
||||
{ 49, "Preferences could not be loaded.#NEWLINE#" }, /* HELPPREFNOLO */
|
||||
{ 50, "Preferences saved to disk.#NEWLINE#" }, /* HELPPREFSAVE */
|
||||
{ 51, "Preferences could not be saved.#NEWLINE#" }, /* HELPPREFNOSA */
|
||||
{ 52, "Could not open directory:#SPACE#" }, /* MSGNODIR */
|
||||
{ 53, "Cannot open file.#NEWLINE#" }, /* MSGNOFILE */
|
||||
{ -1, EMPTYSTRING }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
135
src/main.h
135
src/main.h
|
@ -105,75 +105,94 @@
|
|||
|
||||
\subsection command_stat Statements
|
||||
\verbatim
|
||||
clear Clear console window.
|
||||
def Define function.
|
||||
delete Delete variable or function.
|
||||
digits Set number of significant digits.
|
||||
eval Evaluate arithmetic expression.
|
||||
execute Execute statements in a file.
|
||||
functions Show list of user defined functions.
|
||||
input Change numeral input system (experimental).
|
||||
help Show basic help text.
|
||||
output Change numeral output system (experimental).
|
||||
list Show content of a directory.
|
||||
show Show content of a file.
|
||||
load Load variable and functions from file.
|
||||
save Save variable and functions to file.
|
||||
variables Show list of variables.
|
||||
version Show version string.
|
||||
memory Show internal memory usage.
|
||||
exit Exit program.
|
||||
clear Clear console window
|
||||
def Define function
|
||||
delete Delete variable or function
|
||||
digits Set number of significant digits
|
||||
eval Evaluate arithmetic expression
|
||||
execute Execute statements in a file
|
||||
functions Show list of user defined functions
|
||||
input Change numeral input system
|
||||
help Show basic help text
|
||||
output Change numeral output system
|
||||
list Show content of a directory
|
||||
show Show content of a file
|
||||
load Load variable and functions from file
|
||||
save Save variable and functions to file
|
||||
variables Show list of variables
|
||||
version Show version string
|
||||
memory Show internal memory usage
|
||||
exit Exit program
|
||||
\endverbatim
|
||||
\subsection command_func Base functions
|
||||
\verbatim
|
||||
abs Absolute value of number.
|
||||
sgn Mathematical signum function.
|
||||
round Round to nearest integer number.
|
||||
trunc Discard fraction part of number.
|
||||
floor Mathematical floor function.
|
||||
ceil Mathematical ceiling function.
|
||||
sqrt Square root function (exp 1/2).
|
||||
cbrt Cube root function (exp 1/3).
|
||||
lb Binary logarithm function (base 2).
|
||||
ln Natural logarithm function (base e).
|
||||
lg Common logarithm function (base 10).
|
||||
abs Absolute value of number
|
||||
sgn Mathematical signum function
|
||||
round Round to nearest integer number
|
||||
trunc Discard fraction part of number
|
||||
floor Mathematical floor function
|
||||
ceil Mathematical ceiling function
|
||||
sqrt Square root function (exp 1/2)
|
||||
cbrt Cube root function (exp 1/3)
|
||||
lb Binary logarithm function (base 2)
|
||||
ln Natural logarithm function (base e)
|
||||
lg Common logarithm function (base 10)
|
||||
\endverbatim
|
||||
\subsection command_trig Trigonometric functions
|
||||
\verbatim
|
||||
sin Trigonometric sine function.
|
||||
cos Trigonometric cosine function.
|
||||
tan Trigonometric tangent function.
|
||||
cot Trigonometric cotangent function.
|
||||
sec Trigonometric secant function.
|
||||
csc Trigonometric cosecant function.
|
||||
arcsin Inverse trigonometric sine function.
|
||||
arccos Inverse trigonometric cosine function.
|
||||
arctan Inverse trigonometric tangent function.
|
||||
arccot Inverse trigonometric cotangent function.
|
||||
arcsec Inverse trigonometric secant function.
|
||||
arccsc Inverse trigonometric cosecant function.
|
||||
sin Trigonometric sine function
|
||||
cos Trigonometric cosine function
|
||||
tan Trigonometric tangent function
|
||||
cot Trigonometric cotangent function
|
||||
sec Trigonometric secant function
|
||||
csc Trigonometric cosecant function
|
||||
arcsin Inverse trigonometric sine function
|
||||
arccos Inverse trigonometric cosine function
|
||||
arctan Inverse trigonometric tangent function
|
||||
arccot Inverse trigonometric cotangent function
|
||||
arcsec Inverse trigonometric secant function
|
||||
arccsc Inverse trigonometric cosecant function
|
||||
\endverbatim
|
||||
\subsection command_hype Hyperbolic functions
|
||||
\verbatim
|
||||
sinh Hyperbolic sine function.
|
||||
cosh Hyperbolic cosine function.
|
||||
tanh Hyperbolic tangent function.
|
||||
coth Hyperbolic cotangent function.
|
||||
sech Hyperbolic secant function.
|
||||
csch Hyperbolic cosecant function.
|
||||
arcsinh Inverse hyperbolic sine function.
|
||||
arccosh Inverse hyperbolic cosine function.
|
||||
arctanh Inverse hyperbolic tangent function.
|
||||
arccoth Inverse hyperbolic cotangent function.
|
||||
arcsech Inverse hyperbolic secant function.
|
||||
arccsch Inverse hyperbolic cosecant function.
|
||||
sinh Hyperbolic sine function
|
||||
cosh Hyperbolic cosine function
|
||||
tanh Hyperbolic tangent function
|
||||
coth Hyperbolic cotangent function
|
||||
sech Hyperbolic secant function
|
||||
csch Hyperbolic cosecant function
|
||||
arcsinh Inverse hyperbolic sine function
|
||||
arccosh Inverse hyperbolic cosine function
|
||||
arctanh Inverse hyperbolic tangent function
|
||||
arccoth Inverse hyperbolic cotangent function
|
||||
arcsech Inverse hyperbolic secant function
|
||||
arccsch Inverse hyperbolic cosecant function
|
||||
\endverbatim
|
||||
\subsection command_earl Early trigonometric functions
|
||||
\verbatim
|
||||
ver Versed sine function
|
||||
vcs Versed cosine function
|
||||
cvs Coversed sine function
|
||||
cvc Coversed cosine function
|
||||
hv Haversed sine function
|
||||
hvc Haversed cosine function
|
||||
hcv Hacoversed sine function
|
||||
hcc Hacoversed cosine function
|
||||
arcver Inverse versed sine function
|
||||
arcvcs Inverse versed cosine function
|
||||
arccvs Inverse coversed sine function
|
||||
arccvc Inverse coversed cosine function
|
||||
archv Inverse haversed sine function
|
||||
archvc Inverse haversed cosine function
|
||||
archcv Inverse hacoversed sine function
|
||||
archcc Inverse hacoversed cosine function
|
||||
\endverbatim
|
||||
\subsection command_vars Variables and constant
|
||||
\verbatim
|
||||
pi Trigonometric constant.
|
||||
e Euler's number.
|
||||
i Imaginary unit.
|
||||
ins Result of last calculation.
|
||||
pi Trigonometric constant
|
||||
e Euler's number
|
||||
i Imaginary unit
|
||||
ins Result of last calculation
|
||||
\endverbatim
|
||||
\subsection command_exfunc Example script
|
||||
\verbatim
|
||||
|
@ -250,7 +269,7 @@
|
|||
\page release_page Release history
|
||||
\section release_sec Release history
|
||||
|
||||
\subsection version170 v1.7.0 February 28 2017
|
||||
\subsection version170 v1.7.0 March 12 2017
|
||||
- Introduce scientific notation.
|
||||
- Introduce Not a Number (NaN).
|
||||
- Fixed bugs related to infinity (Inf).
|
||||
|
|
|
@ -13,9 +13,6 @@ evaluator.o: evaluator.cpp
|
|||
functionlist.o: functionlist.cpp
|
||||
${CXX} ${CXXFLAGS} -c functionlist.cpp
|
||||
|
||||
functions.o: functions.cpp
|
||||
${CXX} ${CXXFLAGS} -c functions.cpp
|
||||
|
||||
fgrid.o: fgrid.cpp
|
||||
${CXX} ${CXXFLAGS} -c fgrid.cpp
|
||||
|
||||
|
@ -46,10 +43,10 @@ values.o: values.cpp
|
|||
viewer.o: viewer.cpp
|
||||
${CXX} ${CXXFLAGS} -c viewer.cpp
|
||||
|
||||
lib: evaluator.o functionlist.o functions.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
${AR} rcs libappmain.a evaluator.o functionlist.o functions.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
lib: evaluator.o functionlist.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
${AR} rcs libappmain.a evaluator.o functionlist.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
${RANLIB} libappmain.a
|
||||
|
||||
clean:
|
||||
${DEL} libappmain.a evaluator.o functionlist.o functions.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
${DEL} libappmain.a evaluator.o functionlist.o fgrid.o lexer.o nodes.o operators.o optimizer.o parser.o token.o userfunction.o values.o viewer.o
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
*/
|
||||
|
||||
#include "amath.h"
|
||||
#include "amathc.h"
|
||||
#include "parser.h"
|
||||
#include "viewer.h"
|
||||
#include "optimizer.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
*/
|
||||
|
||||
#include "fgrid.h"
|
||||
#include "functions.h"
|
||||
#include "lib/real.h"
|
||||
|
||||
Grid::Grid(UserFunction* function) :
|
||||
|
|
|
@ -34,6 +34,30 @@ arccotangent.o: arccotangent.cpp
|
|||
arcsecant.o: arcsecant.cpp
|
||||
${CXX} ${CXXFLAGS} -c arcsecant.cpp
|
||||
|
||||
arccovercosine.o: arccovercosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c arccovercosine.cpp
|
||||
|
||||
arccoversine.o: arccoversine.cpp
|
||||
${CXX} ${CXXFLAGS} -c arccoversine.cpp
|
||||
|
||||
archacovercosine.o: archacovercosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c archacovercosine.cpp
|
||||
|
||||
archacoversine.o: archacoversine.cpp
|
||||
${CXX} ${CXXFLAGS} -c archacoversine.cpp
|
||||
|
||||
archavercosine.o: archavercosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c archavercosine.cpp
|
||||
|
||||
archaversine.o: archaversine.cpp
|
||||
${CXX} ${CXXFLAGS} -c archaversine.cpp
|
||||
|
||||
arcvercosine.o: arcvercosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c arcvercosine.cpp
|
||||
|
||||
arcversine.o: arcversine.cpp
|
||||
${CXX} ${CXXFLAGS} -c arcversine.cpp
|
||||
|
||||
ceil.o: ceil.cpp
|
||||
${CXX} ${CXXFLAGS} -c ceil.cpp
|
||||
|
||||
|
@ -76,6 +100,42 @@ havercos.o: havercos.cpp
|
|||
haversin.o: haversin.cpp
|
||||
${CXX} ${CXXFLAGS} -c haversin.cpp
|
||||
|
||||
hyparccosecant.o: hyparccosecant.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparccosecant.cpp
|
||||
|
||||
hyparccosine.o: hyparccosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparccosine.cpp
|
||||
|
||||
hyparccotangent.o: hyparccotangent.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparccotangent.cpp
|
||||
|
||||
hyparcsecant.o: hyparcsecant.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparcsecant.cpp
|
||||
|
||||
hyparcsine.o: hyparcsine.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparcsine.cpp
|
||||
|
||||
hyparctangent.o: hyparctangent.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyparctangent.cpp
|
||||
|
||||
hypcosecant.o: hypcosecant.cpp
|
||||
${CXX} ${CXXFLAGS} -c hypcosecant.cpp
|
||||
|
||||
hypcosine.o: hypcosine.cpp
|
||||
${CXX} ${CXXFLAGS} -c hypcosine.cpp
|
||||
|
||||
hypcotangent.o: hypcotangent.cpp
|
||||
${CXX} ${CXXFLAGS} -c hypcotangent.cpp
|
||||
|
||||
hypsecant.o: hypsecant.cpp
|
||||
${CXX} ${CXXFLAGS} -c hypsecant.cpp
|
||||
|
||||
hypsine.o: hypsine.cpp
|
||||
${CXX} ${CXXFLAGS} -c hypsine.cpp
|
||||
|
||||
hyptangent.o: hyptangent.cpp
|
||||
${CXX} ${CXXFLAGS} -c hyptangent.cpp
|
||||
|
||||
ln.o: ln.cpp
|
||||
${CXX} ${CXXFLAGS} -c ln.cpp
|
||||
|
||||
|
@ -118,10 +178,10 @@ vercos.o: vercos.cpp
|
|||
versin.o: versin.cpp
|
||||
${CXX} ${CXXFLAGS} -c versin.cpp
|
||||
|
||||
lib: absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
${AR} rcs libfunctions.a absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
lib: absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o arccovercosine.o arccoversine.o archacovercosine.o archacoversine.o archavercosine.o archaversine.o arcvercosine.o arcversine.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o hyparccosecant.o hyparccosine.o hyparccotangent.o hyparcsecant.o hyparcsine.o hyparctangent.o hypcosecant.o hypcosine.o hypcotangent.o hypsecant.o hypsine.o hyptangent.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
${AR} rcs libfunctions.a absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o arccovercosine.o arccoversine.o archacovercosine.o archacoversine.o archavercosine.o archaversine.o arcvercosine.o arcversine.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o hyparccosecant.o hyparccosine.o hyparccotangent.o hyparcsecant.o hyparcsine.o hyparctangent.o hypcosecant.o hypcosine.o hypcotangent.o hypsecant.o hypsine.o hyptangent.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
${RANLIB} libfunctions.a
|
||||
|
||||
clean:
|
||||
${DEL} libfunctions.a absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
${DEL} libfunctions.a absolute.o aexcosecant.o aexsecant.o arccos.o arcsin.o arctan.o arccosecant.o arccotangent.o arcsecant.o arccovercosine.o arccoversine.o archacovercosine.o archacoversine.o archavercosine.o archaversine.o arcvercosine.o arcversine.o ceil.o cosecant.o cosine.o cotangent.o covercos.o coversin.o cube.o excosecant.o exsecant.o floor.o hacovercos.o hacoversin.o havercos.o haversin.o hyparccosecant.o hyparccosine.o hyparccotangent.o hyparcsecant.o hyparcsine.o hyparctangent.o hypcosecant.o hypcosine.o hypcotangent.o hypsecant.o hypsine.o hyptangent.o ln.o log10.o log2.o node.o round.o secant.o signum.o sine.o square.o tangent.o trunc.o user.o vercos.o versin.o
|
||||
|
||||
|
|
|
@ -42,5 +42,5 @@ FunctionNode* ArcExcosecantNode::Create(ExpressionNode* expression, char* text,
|
|||
Number* ArcExcosecantNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcExCosecant();
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief A inverse excosecant function in a syntax tree.
|
||||
* @brief An inverse excosecant function in a syntax tree.
|
||||
* @details
|
||||
* More info on the excosecant function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Excosecant
|
||||
|
|
|
@ -31,16 +31,16 @@
|
|||
|
||||
ArcExsecantNode::ArcExsecantNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcExsecantNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcExsecantNode(expression, text, sys);
|
||||
return new ArcExsecantNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcExsecantNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcExSecant();
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief A inverse exsecant function in a syntax tree.
|
||||
* @brief An inverse exsecant function in a syntax tree.
|
||||
* @details
|
||||
* More info on the exsecant function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Exsecant
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "arccovercosine.h"
|
||||
|
||||
ArcCoversedCosineNode::ArcCoversedCosineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcCoversedCosineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcCoversedCosineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcCoversedCosineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcCoVerCosine();
|
||||
return result;
|
||||
}
|
|
@ -27,40 +27,24 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_GRAPH_WINDOW_H
|
||||
#define AMATH_GRAPH_WINDOW_H
|
||||
#ifndef AMATH_FUNCTION_ARCCOVERSEDCOSINE_H
|
||||
#define AMATH_FUNCTION_ARCCOVERSEDCOSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @file graph.h
|
||||
* @brief Logic related to graph of functions.
|
||||
* @brief An inverse coversed cosine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the coversed cosine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Covercosine
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0
|
||||
|
||||
#include "clib.h"
|
||||
#include "lib/fgrid.h"
|
||||
#include "main/functions.h"
|
||||
|
||||
class GraphList;
|
||||
|
||||
class GraphWindow
|
||||
class ArcCoversedCosineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
GraphWindow();
|
||||
virtual ~GraphWindow();
|
||||
virtual void OpenGraphWindow(UserFunction* function) = 0;
|
||||
virtual void CloseGraphWindow() = 0;
|
||||
virtual void DrawGraph(UserFunction* function) = 0;
|
||||
|
||||
protected:
|
||||
virtual void DrawAxis() = 0;
|
||||
GraphWindow* next;
|
||||
Grid* grid;
|
||||
|
||||
friend class GraphList;
|
||||
explicit ArcCoversedCosineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "arccoversine.h"
|
||||
|
||||
ArcCoversedSineNode::ArcCoversedSineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcCoversedSineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcCoversedSineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcCoversedSineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcCoVerSine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCCOVERSEDSINE_H
|
||||
#define AMATH_FUNCTION_ARCCOVERSEDSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse coversed sine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the coversed sine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Coversine
|
||||
*
|
||||
*/
|
||||
class ArcCoversedSineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcCoversedSineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "archacovercosine.h"
|
||||
|
||||
ArcHaCoversedCosineNode::ArcHaCoversedCosineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcHaCoversedCosineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcHaCoversedCosineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcHaCoversedCosineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcHaCoVerCosine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCHACOVERSEDCOSINE_H
|
||||
#define AMATH_FUNCTION_ARCHACOVERSEDCOSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse hacoversed cosine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the hacoversed cosine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Hacovercosine
|
||||
*
|
||||
*/
|
||||
class ArcHaCoversedCosineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcHaCoversedCosineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "archacoversine.h"
|
||||
|
||||
ArcHaCoversedSineNode::ArcHaCoversedSineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcHaCoversedSineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcHaCoversedSineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcHaCoversedSineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcHaCoVerSine();
|
||||
return result;
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
/* @(#)s_matherr.c 1.3 95/01/18 */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -24,34 +22,29 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The origin source code can be obtained from:
|
||||
* http://www.netlib.org/fdlibm/s_matherr.c
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
#ifndef AMATH_FUNCTION_ArcHaCoversedSine_H
|
||||
#define AMATH_FUNCTION_ArcHaCoversedSine_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse hacoversed sine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the hacoversed sine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Hacoversine
|
||||
*
|
||||
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software is freely granted, provided that this notice
|
||||
* is preserved.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
// NOTICE: Not a part of libamath yet
|
||||
|
||||
#include "fdlibm.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
int matherr(struct exception *x)
|
||||
#else
|
||||
int matherr(x)
|
||||
struct exception *x;
|
||||
#endif
|
||||
class ArcHaCoversedSineNode : public FunctionNode
|
||||
{
|
||||
int n=0;
|
||||
if(x->arg1!=x->arg1) return 0;
|
||||
return n;
|
||||
}
|
||||
public:
|
||||
explicit ArcHaCoversedSineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "archavercosine.h"
|
||||
|
||||
ArcHaVersedCosineNode::ArcHaVersedCosineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcHaVersedCosineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcHaVersedCosineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcHaVersedCosineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcHaVerCosine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCHAVERSEDCOSINE_H
|
||||
#define AMATH_FUNCTION_ARCHAVERSEDCOSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse haversed cosine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the haversed cosine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Havercosine
|
||||
*
|
||||
*/
|
||||
class ArcHaVersedCosineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcHaVersedCosineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "archaversine.h"
|
||||
|
||||
ArcHaVersedSineNode::ArcHaVersedSineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcHaVersedSineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcHaVersedSineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcHaVersedSineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcHaVerSine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCHAVERSEDSINE_H
|
||||
#define AMATH_FUNCTION_ARCHAVERSEDSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse haversed sine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the haversed sine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Haversine
|
||||
*
|
||||
*/
|
||||
class ArcHaVersedSineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcHaVersedSineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#include "arcvercosine.h"
|
||||
|
||||
ArcVersedCosineNode::ArcVersedCosineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ArcVersedCosineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcVersedCosineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
Number* ArcVersedCosineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcVerCosine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCVERSEDCOSINE_H
|
||||
#define AMATH_FUNCTION_ARCVERSEDCOSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse versed cosine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the versed cosine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Vercosine
|
||||
*
|
||||
*/
|
||||
class ArcVersedCosineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcVersedCosineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -27,25 +27,20 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file ggraph.h
|
||||
* @brief Gtk specific graph window.
|
||||
*
|
||||
*/
|
||||
#include "arcversine.h"
|
||||
|
||||
#ifdef GTK
|
||||
#include "fgrid.h"
|
||||
#include "functions.h"
|
||||
ArcVersedSineNode::ArcVersedSineNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
}
|
||||
|
||||
class GtkGraphWindow {
|
||||
public:
|
||||
GtkGraphWindow(UserFunction* function);
|
||||
~GtkGraphWindow();
|
||||
FunctionNode* ArcVersedSineNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
{
|
||||
return new ArcVersedSineNode(expression, text, sys);
|
||||
}
|
||||
|
||||
void DrawGraph();
|
||||
|
||||
private:
|
||||
UserFunction* function;
|
||||
Grid *grid;
|
||||
};
|
||||
#endif
|
||||
Number* ArcVersedSineNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ArcVerSine();
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*-
|
||||
* Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Project homepage:
|
||||
* http://amath.innolan.net
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AMATH_FUNCTION_ARCVERSEDSINE_H
|
||||
#define AMATH_FUNCTION_ARCVERSEDSINE_H
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief An inverse versed sine function in a syntax tree.
|
||||
* @details
|
||||
* More info on the versed sine function is available at [Wikipedia]:
|
||||
* https://wikipedia.org/wiki/Versine
|
||||
*
|
||||
*/
|
||||
class ArcVersedSineNode : public FunctionNode
|
||||
{
|
||||
public:
|
||||
explicit ArcVersedSineNode(ExpressionNode* expression, char* text, char* sys);
|
||||
static FunctionNode* Create(ExpressionNode* expression, char* text, char* sys);
|
||||
Number* Evaluate();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -44,4 +44,3 @@ Number* CosecantNode::Evaluate()
|
|||
result = expression->Evaluate()->Cosecant();
|
||||
return result;
|
||||
}
|
||||
|
|
@ -42,6 +42,14 @@
|
|||
#include "arccosecant.h"
|
||||
#include "arccotangent.h"
|
||||
#include "arcsecant.h"
|
||||
#include "arccovercosine.h"
|
||||
#include "arccoversine.h"
|
||||
#include "archacovercosine.h"
|
||||
#include "archacoversine.h"
|
||||
#include "archavercosine.h"
|
||||
#include "archaversine.h"
|
||||
#include "arcvercosine.h"
|
||||
#include "arcversine.h"
|
||||
#include "ceil.h"
|
||||
#include "cosecant.h"
|
||||
#include "cosine.h"
|
||||
|
@ -56,6 +64,18 @@
|
|||
#include "hacoversin.h"
|
||||
#include "havercos.h"
|
||||
#include "haversin.h"
|
||||
#include "hyparccosecant.h"
|
||||
#include "hyparccosine.h"
|
||||
#include "hyparccotangent.h"
|
||||
#include "hyparcsecant.h"
|
||||
#include "hyparcsine.h"
|
||||
#include "hyparctangent.h"
|
||||
#include "hypcosecant.h"
|
||||
#include "hypcosine.h"
|
||||
#include "hypcotangent.h"
|
||||
#include "hypsecant.h"
|
||||
#include "hypsine.h"
|
||||
#include "hyptangent.h"
|
||||
#include "ln.h"
|
||||
#include "log2.h"
|
||||
#include "log10.h"
|
||||
|
@ -70,10 +90,9 @@
|
|||
#include "versin.h"
|
||||
|
||||
#include "main/nodes.h"
|
||||
#include "main/functions.h"
|
||||
|
||||
class FunctionNode;
|
||||
typedef FunctionNode* (*CreateFunctionNode)(ExpressionNode*,char*,char*);
|
||||
typedef FunctionNode* (*CreateFunctionNode)(ExpressionNode*, char*, char*);
|
||||
|
||||
/**
|
||||
* @brief Function definitions of known mathematical functions.
|
||||
|
@ -132,7 +151,15 @@ static const functiondef functiondefs[] = {
|
|||
{"hv", HaVersedSineNode::Create},
|
||||
{"hvc", HaVersedCosineNode::Create},
|
||||
{"hcv", HaCoversedSineNode::Create},
|
||||
{"hcc", HaCoversedCosineNode::Create}
|
||||
{"hcc", HaCoversedCosineNode::Create},
|
||||
{"aver", ArcVersedSineNode::Create},
|
||||
{"avcs", ArcVersedCosineNode::Create},
|
||||
{"acvs", ArcCoversedSineNode::Create},
|
||||
{"acvc", ArcCoversedCosineNode::Create},
|
||||
{"ahv", ArcHaVersedSineNode::Create},
|
||||
{"ahvc", ArcHaVersedCosineNode::Create},
|
||||
{"ahcv", ArcHaCoversedSineNode::Create},
|
||||
{"ahcc", ArcHaCoversedCosineNode::Create}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
ExcosecantNode::ExcosecantNode(ExpressionNode* expression, char* text, char* sys) :
|
||||
FunctionNode(expression, text, sys)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
FunctionNode* ExcosecantNode::Create(ExpressionNode* expression, char* text, char* sys)
|
||||
|
@ -42,6 +42,5 @@ FunctionNode* ExcosecantNode::Create(ExpressionNode* expression, char* text, cha
|
|||
Number* ExcosecantNode::Evaluate()
|
||||
{
|
||||
result = expression->Evaluate()->ExCosecant();
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
|
@ -0,0 +1,224 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{AD6E3CD6-48C4-47D9-94F5-565EE3AF7485}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="absolute.cpp" />
|
||||
<ClCompile Include="aexcosecant.cpp" />
|
||||
<ClCompile Include="aexsecant.cpp" />
|
||||
<ClCompile Include="arccos.cpp" />
|
||||
<ClCompile Include="arccosecant.cpp" />
|
||||
<ClCompile Include="arccotangent.cpp" />
|
||||
<ClCompile Include="arccovercosine.cpp" />
|
||||
<ClCompile Include="arccoversine.cpp" />
|
||||
<ClCompile Include="archacovercosine.cpp" />
|
||||
<ClCompile Include="archacoversine.cpp" />
|
||||
<ClCompile Include="archavercosine.cpp" />
|
||||
<ClCompile Include="archaversine.cpp" />
|
||||
<ClCompile Include="arcsecant.cpp" />
|
||||
<ClCompile Include="arcsin.cpp" />
|
||||
<ClCompile Include="arctan.cpp" />
|
||||
<ClCompile Include="arcvercosine.cpp" />
|
||||
<ClCompile Include="arcversine.cpp" />
|
||||
<ClCompile Include="ceil.cpp" />
|
||||
<ClCompile Include="cosecant.cpp" />
|
||||
<ClCompile Include="cosine.cpp" />
|
||||
<ClCompile Include="cotangent.cpp" />
|
||||
<ClCompile Include="covercos.cpp" />
|
||||
<ClCompile Include="coversin.cpp" />
|
||||
<ClCompile Include="cube.cpp" />
|
||||
<ClCompile Include="excosecant.cpp" />
|
||||
<ClCompile Include="exsecant.cpp" />
|
||||
<ClCompile Include="floor.cpp" />
|
||||
<ClCompile Include="hacovercos.cpp" />
|
||||
<ClCompile Include="hacoversin.cpp" />
|
||||
<ClCompile Include="havercos.cpp" />
|
||||
<ClCompile Include="haversin.cpp" />
|
||||
<ClCompile Include="hyparccosecant.cpp" />
|
||||
<ClCompile Include="hyparccosine.cpp" />
|
||||
<ClCompile Include="hyparccotangent.cpp" />
|
||||
<ClCompile Include="hyparcsecant.cpp" />
|
||||
<ClCompile Include="hyparcsine.cpp" />
|
||||
<ClCompile Include="hyparctangent.cpp" />
|
||||
<ClCompile Include="hypcosecant.cpp" />
|
||||
<ClCompile Include="hypcosine.cpp" />
|
||||
<ClCompile Include="hypcotangent.cpp" />
|
||||
<ClCompile Include="hypsecant.cpp" />
|
||||
<ClCompile Include="hypsine.cpp" />
|
||||
<ClCompile Include="hyptangent.cpp" />
|
||||
<ClCompile Include="ln.cpp" />
|
||||
<ClCompile Include="log10.cpp" />
|
||||
<ClCompile Include="log2.cpp" />
|
||||
<ClCompile Include="node.cpp" />
|
||||
<ClCompile Include="round.cpp" />
|
||||
<ClCompile Include="secant.cpp" />
|
||||
<ClCompile Include="signum.cpp" />
|
||||
<ClCompile Include="sine.cpp" />
|
||||
<ClCompile Include="square.cpp" />
|
||||
<ClCompile Include="tangent.cpp" />
|
||||
<ClCompile Include="trunc.cpp" />
|
||||
<ClCompile Include="user.cpp" />
|
||||
<ClCompile Include="vercos.cpp" />
|
||||
<ClCompile Include="versin.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="absolute.h" />
|
||||
<ClInclude Include="aexcosecant.h" />
|
||||
<ClInclude Include="aexsecant.h" />
|
||||
<ClInclude Include="arccos.h" />
|
||||
<ClInclude Include="arccosecant.h" />
|
||||
<ClInclude Include="arccotangent.h" />
|
||||
<ClInclude Include="arccovercosine.h" />
|
||||
<ClInclude Include="arccoversine.h" />
|
||||
<ClInclude Include="archacovercosine.h" />
|
||||
<ClInclude Include="archacoversine.h" />
|
||||
<ClInclude Include="archavercosine.h" />
|
||||
<ClInclude Include="archaversine.h" />
|
||||
<ClInclude Include="arcsecant.h" />
|
||||
<ClInclude Include="arcsin.h" />
|
||||
<ClInclude Include="arctan.h" />
|
||||
<ClInclude Include="arcvercosine.h" />
|
||||
<ClInclude Include="arcversine.h" />
|
||||
<ClInclude Include="ceil.h" />
|
||||
<ClInclude Include="cosecant.h" />
|
||||
<ClInclude Include="cosine.h" />
|
||||
<ClInclude Include="cotangent.h" />
|
||||
<ClInclude Include="covercos.h" />
|
||||
<ClInclude Include="coversin.h" />
|
||||
<ClInclude Include="cube.h" />
|
||||
<ClInclude Include="defs.h" />
|
||||
<ClInclude Include="excosecant.h" />
|
||||
<ClInclude Include="exsecant.h" />
|
||||
<ClInclude Include="floor.h" />
|
||||
<ClInclude Include="hacovercos.h" />
|
||||
<ClInclude Include="hacoversin.h" />
|
||||
<ClInclude Include="havercos.h" />
|
||||
<ClInclude Include="haversin.h" />
|
||||
<ClInclude Include="hyparccosecant.h" />
|
||||
<ClInclude Include="hyparccosine.h" />
|
||||
<ClInclude Include="hyparccotangent.h" />
|
||||
<ClInclude Include="hyparcsecant.h" />
|
||||
<ClInclude Include="hyparcsine.h" />
|
||||
<ClInclude Include="hyparctangent.h" />
|
||||
<ClInclude Include="hypcosecant.h" />
|
||||
<ClInclude Include="hypcosine.h" />
|
||||
<ClInclude Include="hypcotangent.h" />
|
||||
<ClInclude Include="hypsecant.h" />
|
||||
<ClInclude Include="hypsine.h" />
|
||||
<ClInclude Include="hyptangent.h" />
|
||||
<ClInclude Include="ln.h" />
|
||||
<ClInclude Include="log10.h" />
|
||||
<ClInclude Include="log2.h" />
|
||||
<ClInclude Include="node.h" />
|
||||
<ClInclude Include="round.h" />
|
||||
<ClInclude Include="secant.h" />
|
||||
<ClInclude Include="signum.h" />
|
||||
<ClInclude Include="sine.h" />
|
||||
<ClInclude Include="square.h" />
|
||||
<ClInclude Include="tangent.h" />
|
||||
<ClInclude Include="trunc.h" />
|
||||
<ClInclude Include="user.h" />
|
||||
<ClInclude Include="vercos.h" />
|
||||
<ClInclude Include="versin.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue