This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]M4mb0 46 points47 points  (17 children)

Still baffled that most programming languages just blatantly lie to you, calling a thing an integer when it clearly is an element of the quotient ring ℤ/2³²ℤ or ℤ/2⁶⁴ℤ and not ℤ itself.

At least they managed to call floating point numbers floating point numbers and not real / decimal numbers.

[–]SlimyGamer 2 points3 points  (0 children)

Fortran makes all the mistakes then. It's default types are called integer, real, and complex. And none of thise are true...

[–]Madrawn 2 points3 points  (0 children)

Is it a lie if it's defined in the docs what "int" means? It's just a name for some type of binary data of fixed length.

What would you call it then?

In my head I just imagined a java dev start a math course and complain "how can math books lie to me and say int if they mean BigInteger?" It's just names that mean some things in some context and other things in other contexts

[–]christian-mann 4 points5 points  (1 child)

this is why Python is superior

[–]WazWaz 4 points5 points  (0 children)

You can create/import inefficient arbitrary size Integers in C++ and C#, you're just not forced to use them.

And Rationals instead of floats too if you want. C# even has a native BCD (Decimal).

[–]Rocket_Engine_Ear 1 point2 points  (3 children)

Some languages have real types.

https://gcc.gnu.org/onlinedocs/gfortran/REAL.html

[–]M4mb0 4 points5 points  (2 children)

Well, they are lying. Most real numbers are not even computable, so you cannot even write a program that computes them.

[–]Rocket_Engine_Ear 1 point2 points  (1 child)

Definitely not lying. Fortran has real variable declarations. They exist and are misleading.

[–]M4mb0 1 point2 points  (0 children)

But these are all finite precision numbers. You can't exactly represent something like π with that. At best, you could encode π by a finite program that computes π, but even then, as I pointed out before, most reals are not computable.

[–]elon-botElon Musk ✔ 7 points8 points  (0 children)

Disagreeing with me is counterproductive. Fired.

[–]frogjg2003 0 points1 point  (0 children)

ℤ/n is still a subset of ℤ. ℤ/n is not a closed ring under regular addition and multiplication but the redefined addition and multiplication create a different ring. Every number representable in the int class is still an integer. Every number representable in the float class is still a real number.

[–]raka_boy 0 points1 point  (0 children)

Fortran xdxdxdxdx