[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



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: 
> 
>   // declaration of variables
>   real  pos;
>   real foo;
> 
>   // other stuff occurs before here. . .
>   foo = pos % 6300;
>   $display(pos, "  ", foo);
> 
> For me, foo is consistently zero.  Here's some output:
> 
> 2449.200000  0.000000
> 2480.600000  0.000000
> 2512.200000  0.000000
> 2544.000000  0.000000

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.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user