All pastes #410816 Raw Edit

Miscellany

public c v1 · immutable
#410816 ·published 2007-03-26 18:10 UTC
rendered paste body
#include <stdio.h>#define _USE_MATH_DEFINES#include <math.h>#include <stdlib.h>void dump( double x){  unsigned char* p = (unsigned char*)&x;  for( int i=8; --i >=0; )  //for( int i=0; i++ < 8; )    printf( "%02x", p[i]);}int main(int argc, char* argv[]) {    int i, limit;    double res;    if(argc >= 2)         limit = atoi(argv[1]);    else        return 1;    for(i = 120; i <= limit; i++) {        res = sin(i*M_PI/180);        printf("%d = ", i);        dump(res);        printf("\t\t%.15f\n", res);    }    return 0;}