This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Functions to extract the year, the month and the day of a date integer (like 20151126), without using strings. | |
* | |
* by Unlimiter | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
// returns the number of digits in an integer | |
int get_int_len(int n) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* upisc (Unlimiter's Pair-based Integer String Compression) | |
* A method to compress strings of digit pairs into strings of predefined symbols. | |
* The symbol dictionary doesn't contain every possible combination of pairs, but pairs that can be reversed to produce other pairs. | |
* | |
* In the command line, the program takes 1 argument, the integer string you want compress. It must have an even length. | |
* If one of the pairs in the argument is not in the dictionary, the program reverses it then translates it, after that, it puts a dot after it to denote it has been reversed. | |
* | |
* — Unlimiter | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<limits.h> | |
#include<stdio.h> | |
#include<math.h> | |
// arithmetical definition of "abs" | |
int abs(int i) { | |
return pow((i*i), 0.5); | |
} | |
int f1(int num) |
NewerOlder