gEDA-user: Re: Iverilog-0.8.2 -- does it support % for reals?

Stuart Brorson sdb at cloud9.net
Tue Jul 25 16:05:09 EDT 2006


> Stuart Brorson wrote:
> > As the subject line says -- I am using Icarus Verilog 0.8.2.  I am
> > getting bad results using the modulo operator for reals.  Here's an
> > example: 

[ snip! ]

> 
> It turns out that *verilog* does not support % on reals. So
> the bug in 0.8 is to not give an error message here. This is
> worthy of a bug report.
> 
> BTW, C doesn't support % of doubles either.

OK, thanks.  To close out this thread (and assist future Googlers), I
found that the following works as a "modulo" operator for reals:

  phase = pos/6300 - $rtoi(pos/6300);

Stuart



More information about the geda-user mailing list