Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stdfloat.h version of stdint.h

Tags:

c

math

What standard naming conventions and or math libraries do you use? I currently use

#include <stdint.h>
typedef float  float32_t;
typedef double float64_t;
/*! ISO C99: 7.18 Integer types 8, 16, 32, or 64 bits
intN_t = two’s complement signed integer type with width N, no padding bits.
uintN_t = an unsigned integer type with width N.
floatN_t = N bit IEE 754 float.

        uintN_t             intN_t              floatN_t
bits    unsigned-integer    signed-integer      IEE754 float
8       
16      unsigned short      short               ??"half"
32      unsigned            int                 float
64      unsigned long       long                double
128                                             ?? "Long double" "quad" ??*/

but as you can see I am yet to decide upon a math library.


Original Question: Recommendation for a small math library with Straight forward naming convention.

Does anyone know of any small C libraries with straightforward naming conventions? This is what im using right now:

typedef unsigned short UInt16; typedef short    Int16;
typedef unsigned       UInt32; typedef int      Int32; typedef float  Float32;
typedef unsigned long  UInt64; typedef long int Int64; typedef double Float64;

What do you use??

like image 718
GlassGhost Avatar asked Nov 06 '10 17:11

GlassGhost


1 Answers

Well, since your question is tagged C++ as well, I am going to suggest Boost.Integer. If you are not interested in C++ solutions, please remove that tag from you question.

like image 147
Björn Pollex Avatar answered Sep 21 '22 11:09

Björn Pollex