POV-Ray : Newsgroups : povray.text.scene-files : greatest common divisor : Re: greatest common divisor Server Time
14 Aug 2022 02:21:22 EDT (-0400)
  Re: greatest common divisor  
From: kurtz le pirate
Date: 22 Jan 2022 11:51:20
Message: <61ec3608$1@news.povray.org>
On 13/01/2022 17:30, jr wrote:
> hi,
> 
> posting my (naive) implementation of the "Euclidean"[*] method to calculate the
> gcd, in case it'll be of use to others.  googling for "gcd" (and spelled out) on
> the news.povray site, surprising to me, got zero results

To make it easier to use, you can also make :
(do not pay attention to the order of parameters)

#macro m_gcd(a_,b_)
  #local ta_ = max(a_,b_);
  #local tb_ = min(a_,b_);
  #while (tb_)
  ...



;)

-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.