Contents | < Browse | Browse >
12A. float values
-----------------
REALs (or FLOATs, whatever) are very different in E than in other
languages. This mainly has to do with the fact that E doesn't
really discriminate between types of values. One is advised to
understand these chapters _well_ before attempting to use floats.

In E, a float is just another 32bit value. The E compiler treats
them just like integers or pointers, with the difference that
their bit representation means something different. The E float
format is the IEEEsingle standard.

A float value looks like an integer value with the exception that
somewhere a "." is present. for example, the following are valid 
floats:

	3.14159    .1    1.    -12345.6

these aren't:

	.    1234

(i.e. atleast one "." and one "0-9" char must be present).

You can use these values at almost all places where LONG values
are legal, i.e. if you have have a function or datastructure that
handles arbitrary LONG values, it will also handle floats.

	DEF f=3.14
	myobj.x:=.1
	fun(f,2.73)