/*
 * mul_float.c
 *
 *  Created on: 15-02-2017
 *      Author: Krzysztof Jakubczyk
 */

#include <math.h>

#include "tdefs.h"
#include "misc.h"

#include "helper.h"
#include "mul_float.h"

int mul_initlog(void *arguments, void *logic)
{
	struct mul_args *args = (struct mul_args *)arguments;
	struct mul_logic *log = (struct mul_logic *)logic;

	if(set_float_ptr(args->io.in_float_in,&log->fin))
		return -1;

	if(set_float_ptr(args->io.out_float_out,&log->fout))
		return -1;

	return 0;
}

void mul(void *arguments, void *logic)
{
	struct mul_logic *log = (struct mul_logic *)logic;
	struct mul_args *args = (struct mul_args *)arguments;

	*log->fout=*log->fin*args->params.multiplier;
}
