added make_silly

This commit is contained in:
2017-07-30 18:41:16 -04:00
parent 10817f077c
commit c3c04b558a
3 changed files with 10 additions and 1 deletions

View File

@@ -88,3 +88,11 @@ char* silly_to_string(silly s) {
double silly_to_double(silly s) {
return ((double)s.before + ((double)s.after)/(double)0xffffffff) * (s.sign ? -1 : 1);
}
silly make_silly(short sign, int before, int after) {
silly s;
s.sign = sign;
s.before = before;
s.after = after;
return s;
}