How can I make a pairing function work with negative numbers?

302 Views Asked by At

I am currently researching pairing functions for a computer science class. So far I have learned about pairing functions that work with both integers and decimals. But one major roadblock is that the only pairing functions that I found either work with negative numbers or decimals, but never both.

Is there any pairing function that works with decimals, both positive and negative?