Regardless of whether it is mathematically correct or not, the answers mostly follow a logical pattern (as I described above). That fact could help determine why $calc is returning the values that it returns. I don't know if Khaled simply passes $1 from $calc to the programming language's calculation function, or if he parses it first.

In any case, it is just an observation.

-genius_at_work