norename class real

  builtin

noncreation

  # arithmetic operations
  infix 28 +(other: real): real := builtin "real_add"(self, other)
  infix 28 -(other: real): real := builtin "real_sub"(self, other)
  prefix -: real := builtin "real_neg"(self)
  infix 32 *(other: real): real := builtin "real_mul"(self, other)
  infix 32 /(other: real): real := builtin "real_div"(self, other)
  trunc: int := builtin "real_trunc"(self)
  round: int := builtin "real_trunc"(self + 0.5)
  infix 24 =(other: real): bool := builtin "real_eq"(self, other)
  infix 24 <>(other: real): bool := builtin "real_ne"(self, other)
  infix 24 <(other: real): bool := builtin "real_lt"(self, other)
  infix 24 <=(other: real): bool := builtin "real_le"(self, other)
  infix 24 >(other: real): bool := builtin "real_gt"(self, other)
  infix 24 >=(other: real): bool := builtin "real_ge"(self, other)
  coerce to_real_ref: real_ref := real_ref(self)

  # mathematical operations
  prefix sin: real := builtin "real_sin"(self)
  prefix cos: real := builtin "real_cos"(self)
  prefix tan: real := builtin "real_tan"(self)
  prefix asin: real := builtin "real_asin"(self)
  prefix acos: real := builtin "real_acos"(self)
  prefix atan: real := builtin "real_atan"(self)
  infix 26 atan2(other: real): real := builtin "real_atan2"(self, other)
  prefix sinh: real := builtin "real_sinh"(self)
  prefix cosh: real := builtin "real_cosh"(self)
  prefix tanh: real := builtin "real_tanh"(self)
  prefix exp: real := builtin "real_exp"(self)
  prefix log: real := builtin "real_log"(self)
  prefix log10: real := builtin "real_log10"(self)
  infix 26 pow(other: real): real := builtin "real_pow"(self, other)
  prefix sqrt: real := builtin "real_sqrt"(self)
  prefix ceil: real := builtin "real_ceil"(self)
  prefix floor: real := builtin "real_floor"(self)
  prefix fabs: real := builtin "real_fabs"(self)
  infix 26 ldexp(n: int): real := builtin "real_ldexp"(self, n)
  infix 26 fmod(other: real): real := builtin "real_fmod"(self, other)

predefined

  max_real := builtin "real_max"
  min_real := builtin "real_min"

end

norename class real_ref

  coerce val: real

end
