# LoadSyncAsync().progress is not exact 0.9 with allowSceneActivation set to false

For example i have LoadSceneAsync operation

and set the allowSceneActivation to false

This will always return false

Instead if you do it like this it work

I never experience it but in case it was rounded down it is safer to use this one

i was wondering why my scene never loaded until i found this one sneaky bug . The documentation say 0.9 .

Not sure what you wanna tell here.
Can you link to the documentation to know what this magic 0.9 means?

In general: floats can always be slightly off the actual value they should have because of rounding errors (and the fact that you cannot store an infinite number of digits after the floating-point-separator). â€śAlwaysâ€ť is not quiet true. It actually can happen when some math operations are done with it. if you say `float myFloat = 0.9f;` it will be that value. but you cannot be sure whatâ€™s the result of `float myFloat = 90000f / 100000f;`. It will be very close to 0.9 but maybe not exactly that value because of rounding errors.

Actually, it wonâ€™t.

You know how some simple fractions give infinite repeating decimals, like 1/3 = 0.3333333â€¦? In binary, 9/10 is an infinite repeating decimal, and therefore cannot be represented exactly.

So when you set a float variable equal to the literal value â€ś0.9fâ€ť it doesnâ€™t get the actual value 0.9, it rounds that to the closest value that it can store.

But general rule of thumb: never check if two floats are exactly equal. Check for approximate equality instead. (Unity has a function for this.)

Here is a write-up about how 0.1 + 0.2 != 0.3

1 Like

The problem here is that AsyncOperation.progress is made by drunk monkeys, and uses 0.9f as a magic number. Hereâ€™s the docs, note that they use >= .9f in the example.

Wait, `SceneManager.LoadSceneAsync` is actually done before `isDone` of the `AsyncOperation` is set to true at 90%? Really?

I think the Unity team should start doing code reviewsâ€¦