Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 10-Feb-2011 04:02:07

kenshin1987
Member
Registered: 10-Nov-2010
Posts: 100

scol value

#define MTOI(val) ((val)>>1)
#define MTOP(val) ((val)>>1)
#define ITOM(val) ((val)<<1)
#define PTOM(val) (((val)<<1)+1)
_inline float MTOF(int val) {    return *(float*)&(val);    }
_inline int   FTOM(float val) {    return ((*(int*)&(val)) & 0xfffffffe);    }

these operation >> << &fffffffe

wouldn't it decrease  the numbers's precision?

How scol deal with that.

Offline

#2 10-Feb-2011 10:53:43

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,089
Website

Re: scol value

Hi kenshin!

yes this decrease the float precision ...

but the last bit is used by the VM to determinate the value type hmm

Offline

#3 10-Feb-2011 10:57:16

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: scol value

Yep, as float uses generally IEEE_754 format:
http://en.wikipedia.org/wiki/Floating_p … _computers

Offline

Board footer

Powered by FluxBB