C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
puts("I don't know how to swim!");
please throw a life preserver, I don't care if we need to unwind the stack!
Last edited by ಠ_ಠ; 07-26-2009 at 03:19 PM.
╔╗╔══╦╗
║║║╔╗║║
║╚╣╚╝║╚╗
╚═╩══╩═╝
You need to compile with -SNAFU -allfloats
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
>> Thanks for all the suggestions but despite my constant resizing being inefficient, it's part of the directions, so I will follow that.
In that case, go back to your original code.
Code:set 'nsize' to 1 and allocate a byte. loop (omit the loop control field in the for loop entirely) fread one byte if fread fails, exit the loop increment bitmap::size if bitmap::size is equal to 'nsize', double 'nsize' and realloc (as you had in the original code)
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Haha, you guys seem to be having fun.
Thanks a lot for all the help! I've successfully been able to read from the header all the necessary information and so I'm just working on a nifty encryption now. Thanks again!
>> You need to compile with -SNAFU -allfloats
That won't work with GCC, though. How about -mhard-float -mno-fast-fix -mno-single-exit?
Yeah, that sounds about right.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }