convert () to complex

From PenguinMod Wiki (Official)
Convert () to complex
Jump to navigation Jump to search

The convert () to complex block is a reporter block in the Extra Mathematics extension that converts the real number inputted into a complex one. For example, entering 4 will result in "{"real":4,"imaginary":0}" being reported. The default value is 0.

Workaround

This block can be worked around by reporting JSON with a real value of the wanted number, and an imaginary value of 0:

define convert (num) to complex
return (join [{"real":] (num) [,"imaginary":0}]::operators)::custom cap

The convert () to () reporter block would be used in place of the actual block.