38

Girlfriend had issue with her Python code (she does mathmatics, not actual programming):
```
t = 51.74636335135748
i = int(t*100) // 5174, wrong value
```
instead of
```
t = 51.74636335135748
i = int(t)*100 // 5000, right value...
```

She asked me if I could fix it for her.
I found the issue but wanted her to understand what went wrong.
She didn't care "because she didn't have time for it".
Well, then it's quite simple for me: I have no time to help her :^)

Comments
  • 48
    This is fake.

    Programmers don't have GFs
  • 8
    @Stuxnet We have machine learning nowadays...
  • 11
    Surely int(t) * 100 in the second case is 5100?
  • 2
    @j4cobgarby nope, it actually is `5000` for some reason xD
    atleast, in the code we are using
  • 3
    Wait, there's actually something really funky going on here...
    One time it gives 50.14XXXX and the other time 51.47XXX

    This is odd XD
  • 6
    Ok, figured out why it kept showing different values.

    Due to her code, she doesn't just modify `t` inside the function itself, but she has `t` as a "global" xD (she modifies it somewhere else in memory, not just in the function memory)
  • 4
    "she didn't care bc she has no time" big LOL 😂
Add Comment