Search Unity

Broken calculations

Discussion in 'Scripting' started by Gotfind, May 24, 2015.

  1. Gotfind

    Gotfind

    Joined:
    May 24, 2015
    Posts:
    2
    print(someTexture.height+" / "+someTexture.width+" = "+(someTexture.height/someTexture.width));

    It prints: 1200 / 873 = 1

    Why?
     
  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    int vs float
     
    Gotfind likes this.
  3. Gotfind

    Gotfind

    Joined:
    May 24, 2015
    Posts:
    2
    Thank you so much :) i appreciate your quick answer
     
    JamesLeeNZ likes this.