Skip to content

Instantly share code, notes, and snippets.

View jonnor's full-sized avatar

Jon Nordby jonnor

View GitHub Profile
@milhidaka
milhidaka / convert_float32.c
Created March 13, 2019 04:05
float16 -> float32 conversion in C
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#define DATA_SIZE 2052
float decode(uint16_t float16_value)
{
// MSB -> LSB
// float16=1bit: sign, 5bit: exponent, 10bit: fraction