Skip to content

Instantly share code, notes, and snippets.

@DeclanHoare
DeclanHoare / floattest.c
Created June 23, 2017 13:55
map integers to floats...?
#include <stdio.h>
#include <float.h>
#include <stdint.h>
int main(void)
{
for (uint32_t val = 0; val < UINT32_MAX; val++)
printf("%d -> %f\n", val, *((float*)&val));
return 0;
}
@DeclanHoare
DeclanHoare / sedlang.py
Created January 29, 2017 12:26
I needed to change a bunch of types in the POSTAL source code to use fixed-width equivalents. This was my quick'n'dirty solution.
# Copyright 2017 Declan Hoare
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the