Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
310694e0
Commit
310694e0
authored
Feb 09, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed 'float vs double' source file.
parent
edff8604
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
simmod/ass1/.gitignore
simmod/ass1/.gitignore
+1
-0
simmod/ass1/Makefile
simmod/ass1/Makefile
+15
-8
simmod/ass1/float_vs_double.c
simmod/ass1/float_vs_double.c
+4
-0
No files found.
simmod/ass1/.gitignore
View file @
310694e0
...
@@ -3,3 +3,4 @@ speed
...
@@ -3,3 +3,4 @@ speed
fp
fp
float_double
float_double
report.pdf
report.pdf
fd*
simmod/ass1/Makefile
View file @
310694e0
CC
=
clang
FLAGS
=
-Wall
-Wextra
-std
=
c99
-pedantic
-O0
-lm
FLAGS
=
-Wall
-Wextra
-std
=
c99
-pedantic
-O0
-lm
TYPES
=
float double LD
TYPES
=
float double LD
OPS
=
ADD DIV MULT SQRT
OPS
=
ADD DIV MULT SQRT
all
:
fp speed report.pdf f
loat_double
all
:
fp speed report.pdf f
d
%.pdf
:
%.tex
%.pdf
:
%.tex
pdflatex
$^
pdflatex
$^
...
@@ -12,23 +13,29 @@ speed: speed.c
...
@@ -12,23 +13,29 @@ speed: speed.c
for
t
in
$(TYPES)
;
do
\
for
t
in
$(TYPES)
;
do
\
for
o
in
$(OPS)
;
do
\
for
o
in
$(OPS)
;
do
\
sed
"s#{TYPE}#
$$
t#"
$^
|
sed
"s#{OP}#
$$
o#"
>
speed.
$$
t.
$$
o.c
;
\
sed
"s#{TYPE}#
$$
t#"
$^
|
sed
"s#{OP}#
$$
o#"
>
speed.
$$
t.
$$
o.c
;
\
gcc
$(FLAGS)
-o
speed.
$$
t.
$$
o speed.
$$
t.
$$
o.c
;
\
$(CC)
$(FLAGS)
-o
speed.
$$
t.
$$
o speed.
$$
t.
$$
o.c
;
\
rm
speed.
$$
t.
$$
o.c
;
\
rm
speed.
$$
t.
$$
o.c
;
\
done
;
\
done
;
\
done
;
done
;
touch
$@
touch
$@
fp
:
floating_point.o
fp
:
floating_point.o
gcc
$(FLAGS)
-o
$@
$^
$(CC)
$(FLAGS)
-o
$@
$^
float_double
:
float_vs_double.o
fd
:
float_vs_double.c
gcc
$(FLAGS)
-o
$@
$^
for
t
in
float double
;
do
\
sed
"s#{TYPE}#
$$
t#"
$^
>
fd.
$$
t.c
;
\
$(CC)
$(FLAGS)
-o
fd.
$$
t fd.
$$
t.c
;
\
rm
fd.
$$
t.c
;
\
done
;
touch
$@
%.o
:
%.c
%.o
:
%.c
gcc
$(FLAGS)
-o
$@
-c
$^
$(CC)
$(FLAGS)
-o
$@
-c
$^
%.s
:
%.c
%.s
:
%.c
gcc
$(FLAGS)
-o
$*
$^
$(CC)
$(FLAGS)
-o
$*
$^
clean
:
clean
:
rm
-vf
*
.o
*
.i
*
.s fp speed speed.
*
.
*
floating_point
rm
-vf
*
.o
*
.i
*
.s fp fd
*
speed speed.
*
.
*
floating_point
\
report.pdf
*
.aux
*
.log
*
.toc
simmod/ass1/float_vs_double.c
View file @
310694e0
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
{
TYPE
}
sum_forward
(
int
N
);
{
TYPE
}
sum_backward
(
int
N
);
int
main
(
void
)
{
int
main
(
void
)
{
puts
(
"Using type {TYPE}."
);
puts
(
"Using type {TYPE}."
);
...
@@ -32,3 +35,4 @@ int main(void) {
...
@@ -32,3 +35,4 @@ int main(void) {
return
sum
;
return
sum
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment