use bigrat;print+(1e1000/pop()*pop)=~"/"?N:Y,$/ [download]
In reply to Re^3: Determining if a rational number terminates by ColonelPanic in thread Determining if a rational number terminates by blackle