Users on quest and PC hardware do proper double math. However, when doing double math on the pico in udon, incorrect values like Infinity, NaN and very low scientific values are generated. This can be tested in this world https://vrchat.com/home/world/wrld_a59ea2d0-375d-431e-b6e8-ca0fa2c3a8a5
On PC and a quest all of these values should be normal, but on a pico they are all over the place. Attached is a image of the PC version compared to the PICO version of the output. I have also attached the script used to generate this output. I hope this gets fixed fairly fast as its kind of a major issue right now since all worlds that use math like this are seeing garbled values. The reason we can tell its just double math and not float math is because when we force a float with 3.3f, we get the proper value
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using TMPro;
public class test : UdonSharpBehaviour
{
public TextMeshProUGUI text;
void Start()
{
//get the text component
text = GetComponent<TextMeshProUGUI>();
const float testvar1value = 1.190284f;
float testvar1 = testvar1value;
const float testvar2value = 0.2982327f;
float testvar2 = testvar2value;
//start the tests
text.text =
$@"Testing variables:
{nameof(testvar1)}: {testvar1}f
{nameof(testvar2)}: {testvar2}f
Equation Tests:
Runtime:
{nameof(testvar1)} / 3.3 = {testvar1 / 3.3}
{nameof(testvar1)} / 1.65 = {testvar1 / 1.65}
{nameof(testvar1)} / 3.3
2 = {testvar1 / 3.3
2}
{nameof(testvar1)} / 3.3f = {testvar1 / 3.3f}
{nameof(testvar1)} / 1.65f = {testvar1 / 1.65f}
{nameof(testvar1)} / 3.3f
2f = {testvar1 / 3.3f
2f}
({nameof(testvar1)} / 3.3) + {nameof(testvar2)} = {(testvar1 / 3.3) + testvar2}
({nameof(testvar1)} / 3.3
2) + {nameof(testvar2)} = {(testvar1 / 3.3
2) + testvar2}
({nameof(testvar1)} / 1.65) + {nameof(testvar2)} = {(testvar1 / 1.65) + testvar2}
({nameof(testvar1)} / 3.3f) + {nameof(testvar2)} = {(testvar1 / 3.3f) + testvar2}
({nameof(testvar1)} / 3.3f
2f) + {nameof(testvar2)} = {(testvar1 / 3.3f
2f) + testvar2}
({nameof(testvar1)} / 1.65f) + {nameof(testvar2)} = {(testvar1 / 1.65f) + testvar2}
Constants:
{testvar1value} / 3.3 = {testvar1value / 3.3}
{testvar1value} / 1.65 = {testvar1value / 1.65}
{testvar1value} / 3.3
2 = {testvar1value / 3.3
2}
{testvar1value} / 3.3f = {testvar1value / 3.3f}
{testvar1value} / 1.65f = {testvar1value / 1.65f}
{testvar1value} / 3.3f
2f = {testvar1value / 3.3f
2f}
({testvar1value} / 3.3) + {testvar2value} = {(testvar1value / 3.3) + testvar2value}
({testvar1value} / 3.3
2) + {testvar2value} = {(testvar1value / 3.3
2) + testvar2value}
({testvar1value} / 1.65) + {testvar2value} = {(testvar1value / 1.65) + testvar2value}
({testvar1value} / 3.3f) + {testvar2value} = {(testvar1value / 3.3f) + testvar2value}
({testvar1value} / 3.3f
2f) + {testvar2value} = {(testvar1value / 3.3f
2f) + testvar2value}
({testvar1value} / 1.65f) + {testvar2value} = {(testvar1value / 1.65f) + testvar2value}
";
}
}