-{pervasive, real, withIdentity} = require './vhelpers'
+{numeric, pervasive, real, withIdentity} = require './vhelpers'
 {APLArray} = require '../array'
+{simplify} = require '../complex'
 
 @['⌊'] = withIdentity new APLArray([Infinity], []), pervasive
 

  # ⌈¯12.3 <=> ¯12
  # ⌈¯123  <=> ¯123
  # ⌈'a'   !!! DOMAIN ERROR
  # ⌈12j3  !!!
  # ⌈0 5 ¯5 (○1) ¯1.5 <=> 0 5 ¯5 4 ¯1
  monad: real Math.ceil

  # Greater of (`⌈`)
  #

  # ⌊¯12.3 <=> ¯13
  # ⌊¯123  <=> ¯123
  # ⌊'a'   !!! DOMAIN ERROR
  # ⌊12j3      <=> 12j3
  # ⌊1.2j2.3   <=> 1j2
  # ⌊1.2j¯2.3  <=> 1j¯3
  # ⌊¯1.2j2.3  <=> ¯1j2
  # ⌊¯1.2j¯2.3 <=> ¯1j¯3
  # ⌊0 5 ¯5 (○1) ¯1.5   <=> 0 5 ¯5 3 ¯2
  monad: numeric Math.floor,
    (x) ->
      [re, im] = [(Math.floor x.re), (Math.floor x.im)]
      [r, i] = [x.re - re, x.im - im]
      if r + i >= 1
        if r >= i then re++ else im++
      simplify re, im

  # Lesser of (`⌊`)
  #
