Mathf.Approximately not working correctly on iPhone

Using an iPhone 3G and XCode 3.2.

Mathf.Approximately (1.0, 10.0/10.0) returns TRUE as expected at Unity Remote.

Returns FALSE (incorrectly) at the XCode debugger causing game logic errors.

I’ve noticed that Mathf.Epsilon returns 0 at the iPhone.

Help?

I’ve submitted it as a bug.

ApproxEqual (1.0, 10.0/10.0, 0.001) returns true as expected.

Same here.
My code works on editor but not on device.

I’m using expressions like

if (Mathf.Approximately(Time.fixedTime % 1f, 0.0f))

and

if (Mathf.Approximately(volume, 0f))

What’s the latest news on this, it seems the bug is still present…

The code I put in my first post should help everyone out for the time-being, else where are the Unity Support team? This thread has been open for ages.

Hi, I’m having the same trouble with the below code checking for joystick movement, any help would be gratefully appreciated.

if(!Mathf.Approximately(movement.y, 0) || !Mathf.Approximately(movement.x, 0))

I’m having this problem too… has it really not been fixed in over 16 months?

The bug is related to the fact that iOS puts VFP into faster, but less accurate mode. We implemented workaround in Unity 3.5.

That’s great to hear.

What’s the workaround? Using Mathf.Approximately still chokes out on 3.5.2.