413414415416417418419420421422423
throw ERT.badarg(obj); } @BIF static public EBinary float_to_binary(EObject obj) { EDouble value; if ((value = obj.testFloat()) != null) { return new EBinary(value.format(ERT.NIL).getBytes(IO.ISO_LATIN_1)); } throw ERT.badarg(obj); }
422423424425426427428429430431432
throw ERT.badarg(obj); } @BIF static public EBinary float_to_binary(EObject obj, EObject options) { EDouble value; if ((value = obj.testFloat()) != null) { return new EBinary(value.format(options).getBytes(IO.ISO_LATIN_1)); } throw ERT.badarg(obj, options); }
431432433434435436437438439440441
throw ERT.badarg(obj, options); } @BIF static public EString float_to_list(EObject obj) { EDouble value; if ((value = obj.testFloat()) != null) { return new EString(value.format(ERT.NIL)); } throw ERT.badarg(obj); }
440441442443444445446447448449450
throw ERT.badarg(obj); } @BIF static public EString float_to_list(EObject obj, EObject options) { EDouble value; if ((value = obj.testFloat()) != null) { return new EString(value.format(options)); } throw ERT.badarg(obj, options); }
453454455456457458459460461462463
public static EDouble binary_to_float(EObject obj) { EBinary bin = obj.testBinary(); if (bin != null) { try { double d = Double.parseDouble( new String(bin.getByteArray(), IO.ISO_LATIN_1) ); return new EDouble(d); } catch (NumberFormatException e) { // ignore // } } throw ERT.badarg(obj);
10491050105110521053105410551056105710581059
static public EInteger trunc(EObject v1) { EInteger i1; if ((i1 = v1.testInteger()) != null) { return i1; } EDouble n1; if ((n1 = v1.testFloat()) != null) { return trunc(n1.value); } throw ERT.badarg(v1); }
10801081108210831084108510861087108810891090
return ERT.box(Math.round(d.value)); } @BIF(name = "round") static public EInteger round(EObject o) { EDouble d; if ((d = o.testFloat()) != null) return ERT.box(Math.round(d.value)); EInteger i; if ((i = o.testInteger()) != null)
110311041105110611071108110911101111
return ERT.box(Math.round(d.value)); } @BIF(name = "round", type = Type.GUARD) static public EInteger round$g(EObject o) { EDouble d = o.testFloat(); if (d == null) return null; return ERT.box(Math.round(d.value)); }