@ -0,0 +1,18 @@
#include "logarithmicFunctions.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double* logarithm_two_integer(int base, int num){
if(base <= 1 || num <= 0){
return NULL;
}
double* result = (double*)malloc(sizeof(double));
if (result == NULL) {
*result = log(num) / log(base);
return result;
@ -0,0 +1,6 @@
#ifndef THEADMIRALS_LOGARITHMICFUNCTIONS_H
#define THEADMIRALS_LOGARITHMICFUNCTIONS_H
double* logarithm_two_integer(int base, int num);
#endif //THEADMIRALS_LOGARITHMICFUNCTIONS_H
#include "../src/logarithmicFunctions.h"
#include "unity.h"
#include "limits.h"
void setUp(void) {
// set stuff up here
void tearDown(void) {
// clean stuff up here
void test_logarithmicFunctions_logarithmiccalculation(void){
double expectedResult = 3.000000;
double* result;
result = logarithm_two_integer(2,8);
TEST_ASSERT_EQUAL_DOUBLE(expectedResult, *result);