Skip to content

Instantly share code, notes, and snippets.

View luisfergromo's full-sized avatar
💭
👨🏻‍💻Programming

Luis Romo luisfergromo

💭
👨🏻‍💻Programming
View GitHub Profile
@luisfergromo
luisfergromo / ieee754.h
Last active February 5, 2017 01:28
Simple precision 32bits struct
struct {//Already works
unsigned int mantissa : 23;
unsigned int exponent : 8;
unsigned int sign : 1;
}bits;
@luisfergromo
luisfergromo / floating_point_ieee.c
Created February 4, 2017 05:44 — forked from khajavi/floating_point_ieee.c
Converting floating-point number to IEEE754 representation by using union and struct in c.
#include <stdio.h>
/*
* See also : http://class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html
*/
union FloatingPointIEEE754 {
struct {
unsigned int mantissa : 23;
unsigned int exponent : 8;
unsigned int sign : 1;