You seem to have misunderstod slightly.
I don't want the output to change, depending on the input - that would be silly.
This is a hyperthetical question, which is why I was a bit ambiguous.
If I had a 24v supply (for example), but wanted to get rid of spikes etc, and to have regulated power, but wanted the output to be 24v also. Even if the input changed, I still want the output to be 24v.
Basically, I am looking for a regulating circuit that requires no headroom at all.
Yeah, caps and inductors would be suitable.
I will look up buck-boost, thanks Russlk
As I say, this is not a real situation, I just wondered if there was any common way of doing this.