OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
CVS: cvs.openbsd.org: src

From: Otto Moerbeek (ottocvs.openbsd.org)
Date: Wed Dec 01 2004 - 02:29:38 CST


CVSROOT: /cvs
Module name: src
Changes by: ottocvs.openbsd.org 2004/12/01 01:29:38

Modified files:
        usr.bin/dc : bcode.c

Log message:
Fix stop condition for sqrt. Due to the fact that we're doing Newton
iteration with intgeres, the stop condition is reached if x_n == x_n+1, or
the difference is one, but only stop if that is hit a second time. Avoids
looping with difference 1,-1,1,-1... Problem spotted by Paul de Weerd.
Regress tested against 4.2BSD dc(1) and GNU dc(1).