Page 1 of 1

Need help to translate C code to Flowcode

Posted: Mon Jul 08, 2013 1:45 pm
by Mathy
Hello,

Im trying to translate C code ( or C++? ) to Flowcode but I don't understand one part :

Code: Select all

float invSqrt(float number) {
  volatile long i;
  volatile float x, y;
  volatile const float f = 1.5F;

  x = number * 0.5F;
  y = number;
  i = * ( long * ) &y;
  i = 0x5f375a86 - ( i >> 1 );
  y = * ( float * ) &i;
  y = y * ( f - ( x * y * y ) );
  return y;
}
What do this line mean :

Code: Select all

i = * ( long * ) &y;
??
How to translate this into flowcode ?

Thank you for your help :)

Re: Need help to translate C code to Flowcode

Posted: Mon Jul 08, 2013 3:36 pm
by dazz
Hi Mathy
not too good with c still learning but i will try to help, but i did find this have a read im sure it will help http://blog.quenta.org/2012/09/0x5f3759df.html

Regards
Dazz

Re: Need help to translate C code to Flowcode

Posted: Tue Jul 09, 2013 6:02 pm
by Mantas
Hi Mathy,

I have already done this last year. Have a look at this post: http://www.matrixmultimedia.com/mmforum ... 48&t=11633

BR,
Mantas