Skip to content

Instantly share code, notes, and snippets.

@ericmjonas
Created April 7, 2009 17:52
Show Gist options
  • Save ericmjonas/91357 to your computer and use it in GitHub Desktop.
Save ericmjonas/91357 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
inline float test_log(float val) /// , const float *lookup_table, const int n)
{
int * exp_ptr = ((int*)&val);
int x = *exp_ptr; /*x is the float treated as an integer*/
printf("%X\n", x);
return 1.0;
}
int main()
{
float val = 1000.0;
std::cin >> val;
int * exp_ptr = ((int*)&val);
int x = *exp_ptr; /*x is the float treated as an integer*/
printf("pre-call %8.8X\n", x);
// float result1 = icsi_log(val, LOOKUP_TABLE, N);
float result12 = test_log(val);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment