Check fib() overflow in bellard.otccex.c
Whereas fact() (factorial) is an overflow if n > 12 the Fibonacci is an overflow if n > 48. In this case it reports an empty string - when it finally finishes. For instance if you use n = 99 it takes a long time to finish. Since n == 49 prints an empty value we check for overflow just like the author did for factorial. Add compilation of bellard.otccex.c to Makefile; this can be compiled as 64-bit so we no longer specify -m32 in ARCH but instead we do that explicitly for bellard.c. This way users can at least enjoy the supplementary program even if not by the bellard.c directly compiling and executing it.
This commit is contained in:
1 parent
9990fe2abd
commit
5c4f7ac088
3 files changed
+27
-14
No files matched your search
@@ -55,7 +55,7 @@ CSTD= -std=gnu99
|
||||
# Some entries require 32-bitness: ARCH= -m32
|
||||
# Some entries require 64-bitness: ARCH= -m64
|
||||
#
|
||||
ARCH= -m32
|
||||
ARCH=
|
||||
|
||||
# Defines that are needed to compile
|
||||
#
|
||||
@@ -131,6 +131,11 @@ all: data ${TARGET}
|
||||
supernova deep_magic magic charon pluto
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
@echo "WARNING: ${PROG}.c must be compiled as 32-bit to use with the entry itself;"
|
||||
@echo "if you cannot use -m32 this will NOT work!"
|
||||
${CC} ${CFLAGS} -m32 $< -o $@ ${LIBS}
|
||||
|
||||
${PROG}.otccex: ${PROG}.otccex.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
|
||||
# alternative executable
|
||||
|
||||
Reference in new issue
Block a user