aboutsummaryrefslogtreecommitdiff
path: root/sem3/algo/mm3
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-02-15 20:28:59 +0100
committerJulian T <julian@jtle.dk>2020-02-15 20:28:59 +0100
commit8076d839bf69e619f2e504122ec2ceb790a0b978 (patch)
treefa6cb7c649939c3a002676ce142105360d3d2fd6 /sem3/algo/mm3
parentf17e8e195bd1ee3f911ae311dce8e8f7df4f8457 (diff)
Changed to a more consistent codestyle
Diffstat (limited to 'sem3/algo/mm3')
-rw-r--r--sem3/algo/mm3/multiply.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sem3/algo/mm3/multiply.c b/sem3/algo/mm3/multiply.c
index e454de3..da8068c 100644
--- a/sem3/algo/mm3/multiply.c
+++ b/sem3/algo/mm3/multiply.c
@@ -3,12 +3,13 @@
#include <stdint.h>
#include <time.h>
-uint64_t mult(uint64_t x, uint64_t y, unsigned int bits) {
+uint64_t mult(uint64_t x, uint64_t y, unsigned int bits)
+{
/* Check if they expect more than 64 bits. */
- if( bits > 64 ) {
+ if ( bits > 64 ) {
printf("Sorry we cant handle higher than 64 bits\n");
exit(1);
- } else if(bits <= 1) {
+ } else if (bits <= 1) {
return x && y;
}
@@ -37,7 +38,8 @@ uint64_t mult(uint64_t x, uint64_t y, unsigned int bits) {
}
-int main(void) {
+int main(void)
+{
uint32_t a = 0xFFFFFF;
uint8_t b = 55;