Created
April 7, 2009 17:52
-
-
Save ericmjonas/91357 to your computer and use it in GitHub Desktop.
This file contains 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 <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