Skip to content

Instantly share code, notes, and snippets.

View kvanbere's full-sized avatar
:octocat:
We write and test real time control software. @cuedo

Kyle Van Berendonck kvanbere

:octocat:
We write and test real time control software. @cuedo
View GitHub Profile
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:26
(+) :: Int -> Int -> Int
(I# a) + (I# b) = I# (a +# b)
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:25
g :: Int
g = f_Just (Just 5)
h :: Int
h = f_Nothing
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:24
f_Just :: Maybe Int -> Int
f_Just (Just a) = a
f_Nothing :: Int
f_Nothing = 0
f :: Maybe Int -> Int
f x = case x of
Just a -> f_Just a
Nothing -> f_Nothing
@kvanbere
kvanbere / .hs
Created December 15, 2017 10:22
f :: Maybe Int -> Int
f x = case x of
Just a -> a
Nothing -> 0
g :: Int
g = f (Just 5)
h :: Int
h = f Nothing
.LCPI1_0:
.quad 4633260719236591239 # double 57.29746936176985
torad2(double):
mulsd .LCPI1_0(%rip), %xmm0
ret
@kvanbere
kvanbere / .c
Created December 15, 2017 10:12
#define PI (3.1415)
double torad2(double n) {
return 180 / PI * n;
}
.LCPI0_0:
.quad 4640537203540230144 # double 180
.LCPI0_1:
.quad 4614256447914709615 # double 3.1415
torad1(double):
mulsd .LCPI0_0(%rip), %xmm0
divsd .LCPI0_1(%rip), %xmm0
ret
@kvanbere
kvanbere / .c
Last active December 15, 2017 10:11
#define PI (3.1415)
double torad1(double n) {
return n * 180 / PI;
}
@kvanbere
kvanbere / .c
Created December 15, 2017 09:31
important_t *counting = NULL;
safelyPrintImportant(counting);
@kvanbere
kvanbere / .c
Created December 15, 2017 09:29
safelyPrintImportant(NULL);
// warning: warning: null passed to a callee which requires a non-null argument [-Wnonnull]