Tag
Hash :
4d267e43
Author :
Thomas de Grivel
Date :
2023-06-09T11:08:13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/* c3
* Copyright 2022,2023 kmx.io <contact@kmx.io>
*
* Permission is hereby granted to use this software granted the above
* copyright notice and this permission paragraph are included in all
* copies and substantial portions of this software.
*
* THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
* PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
/**
* @file float.h
* @brief Floating point numbers operations.
*
* Structure to manipulate floating point numbers.
*/
#ifndef FLOAT_H
#define FLOAT_H
#include "types.h"
/* Stack-allocation compatible functions */
s_float * float_init (s_float *f);
s_float * float_init_1 (s_float *f, const s8 *s);
s_float * float_init_sw (s_float *f, sw integer, sw bitshift);
/* Heap-allocation compatible functions, call float_delete after use */
void float_delete (s_float *f);
s_float * float_new (s_float *f);
s_float * float_new_1 (s_float *f, const s8 *s);
s_float * float_new_sw (s_float *f, sw integer, sw bitshift);
/* Modifiers */
s_float * float_add (s_float *a, s_float *b);
s_float * float_mul (s_float *a, s_float *b);
s_float * float_neg (s_float *f);
s_float * float_sq (s_float *f);
s_float * float_sqrt (s_float *f);
s_float * float_sub (s_float *a, s_float *b);
#endif /* FLOAT_H */