Logo   Information, Signal, Images et ViSion C.N.R.S.   GdR   M.E.S.R.

divider



Purpose
Find dividers of an integer, closest from the square root of the integer.


Synopsis
[N,M] = divider(N1)


Description
divider find two integers N and M such that M*N=N1, with M and N as close as possible from sqrt(N1).


Examples

         N1=256; [N,M]=divider(N1); [N,M]
         ans = 
               16    16 
         N1=258; [N,M]=divider(N1); [N,M]
         ans = 
               6     43



Eric Chassande-Mottin 2005-10-26

© GdR ISIS - Contact