September 10, 2009

Hardcor...coded IEEE floats for daedalus



I just implemented John R. Hauser's SoftFloat as Daedalus Externals in G2Ext.

(The text on the pic to the left means: "Black coffee, dude!")



// Creates a float out of a specified integer
func int ex_fmk(var int a);
 // Converts a specified float to an integer
func int ex_ftoi(var int a);
 // Adds the specified floats (a + b)
func int ex_fadd(var int a, var int b);
 // Subtracts the specified floats (a - b)
func int ex_fsub(var int a, var int b);
 // Multiplies the specified floats (a * b)
func int ex_fmul(var int a, var int b);
 // Divides the specified floats (a / b)
func int ex_fdiv(var int a, var int b);
 // Returns the remainder of the specified floats
func int ex_frem(var int a, var int b);
 // Returns the square root of the specified float
func int ex_fsqrt(var int a);
 // rounds the float (all after comma digits will be zero)
func int ex_frnd(var int a);
 // Returns 1 if float 'a' is equal the corresponding value 'b', and 0 otherwise.
func int ex_feq(var int a, var int b);
 // Returns 1 if float 'a' is less than or equal the corresponding value 'b', and 0 otherwise.
func int ex_fle(var int a, var int b);
 // Returns 1 if float 'a' is less than the corresponding value 'b', and 0 otherwise.
func int ex_flt(var int a, var int b);