Geogebra treats the dta as symbolical expressions. Matlab converts -2159/277 to a numericalvalues as default. If you want to use symbolic calculations, use sym().
Do not check numerical floating point values to be exactly 0 in a condition of an if command. Calculations with numerical values include rounding effects, which cannot be neglected:
There are no well defined fixed limits and it depends on the application what you have to "consider as 0".
A numerical algorithm requires an analysis of the rounding effects to estimate the reliability of the result.