I wanted to calculate and simulate clock phase shifting, when I ran into the problem that VHDL has no `mod` operator defined for REAL values.

I check my old VHDL book and this [online source](http://www.csee.umbc.edu/portal/help/VHDL/operator.html). Both mention `mod` for integers, but not for numbers (including floats).

GHDL also reports `mod` as unknown.

Example calculation: 

```
constant Period     : TIME := 10.0 ns;
constant PhaseDelay : TIME := Period * (((Phase + 360.0) mod 360.0) / 360.0);

```

**Why is the mod operator not defined for real values?**

Modulo/Remainer definition for positive **integer** values a, b:  

`a = (a/b)*b + (a REM b)`

This equation can be used for remainer calculation on negative numers, too. The modulo operation on negative numbers need some tricks to handle the sign, but it's also base on add, sub, mult, div.