PDA

View Full Version : Discretizing / Normalizing Values in C/C++


Zetr0
03 December 2006, 16:09
heys guys,

I am having trouble relating math to code, I can write it on paper, I can understand it but tring to get it into code is... well escaping my sore little brain...

http://www.guildserver.co.uk/tempfiles/discretizing.png

I just need this in C source and well google is being a biggot!!

musashi5150
03 December 2006, 16:16
#include <math.h>

double result = 1 / ( 1 + exp(-1*y) );



How's that ? :D

http://www.cppreference.com/stdmath/exp.html explains the exp function - I use this site as an online C/C++ reference.

Zetr0
03 December 2006, 16:17
Sweeet!!!!!!!!

Photon
04 December 2006, 03:38
hmm why not 1 / ( 1 + exp(-y) ); ?

musashi5150
04 December 2006, 09:29
hmm why not 1 / ( 1 + exp(-y) ); ?

That'd be fine too :)