Search Unity

Resolved async op not quite reaching 0.9 according to Rider debugger

Discussion in 'Scripting' started by laurentlavigne, Mar 18, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    upload_2021-3-17_22-2-50.png
    is this normal? the usual stuff when you load a scene is to wait for progress to be >=0.9
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    I don't think .9 is possible to represent exactly in binary, just like .1
     
    Antistone and laurentlavigne like this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    that was taken 10 seconds after load was initiated, load takes 0.5 seconds so that value is weird
    also doesn't >= require that at least the 2 first digits be 0.9?
     
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    No, the comparison would be done at the binary level. There is no comparing digits, which don't really exist.

    I think if you tried something like if (thatValue >= 0.9) Debug.Log("It is >= 0.9"); than it would print the message. The compiler would likely turn your 0.9 into the same binary representation that is 0.89999999976
     
    laurentlavigne likes this.
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    oh gotcha, thanks
    then rider is just showing me the number in its pure form i guess