heptagon/examples/MissionComputer_for_Core/math.ept
Cédric Pasteur e9da3c0313 Added an example ported from SCADE
All the files compile. The code generation was 
not tested yet.
2010-07-28 14:17:54 +02:00

12 lines
324 B
Plaintext

fun abs(a : float) returns (o : float)
let
o = if 0.0 <=. a then a else -. a;
tel
(* -- Returns 1.0 if input is greater than 0.0,
-- -1.0 if input is less than 0.0
-- and 0.0 if input is equal to 0.0 *)
fun sign(a : float) returns (o : float)
let
o = if a >. 0.0 then 1.0 else if 0.0 =. a then 0.0 else -. 1.0;
tel