Skip to main content
3 of 3
edited body
user avatar
user avatar

Axiom, 57 bytes

f(x)==(y:=abs(x);y>9999 or y<0.0001=>"ObjFloatErr ";1./x)

test code and results

(21) -> [[i,f(i)] for i in [-2,-1,-0.0001,-0.00001,9999,10000]]
   (21)
   [[- 2.0,- 0.5], [- 1.0,- 1.0], [- 0.0001,- 10000.0],
    [- 0.00001,"ObjError 1/x"], [9999.0,0.0001000100 0100010001],
    [10000.0,"ObjError 1/x"]]
user58988