Post Reply 
I may have discovered a bug in the input function...
09-09-2017, 04:01 AM
Post: #5
RE: I may have discovered a bug in the input function...
There is a huge difference between "integers" in Home and in CAS.

In Home, an "integer" has a "#" sign in front of it, and is displayed in the current base (decimal, hex, octal, or binary). Without the "#" sign, all numbers are reals, whether they have a decimal point or not.

In CAS, an "integer" is any number without a decimal point in it. They are always displayed in base 10. A real (AKA a "float") is any number with a decimal point in it, even if it has no fractional part. Numbers with "#" in front are not allowed in CAS. If typed, they are converted immediately to CAS integers.

To make matters even more complicated, there is a difference between the TYPE() and type() commands in CAS, and the values returned by type() differ between CAS and Home.

CAS: TYPE(123) --> 0.
CAS: type(123) --> DOM_INT
CAS: type(123)+0. --> 2.
CAS: TYPE(123.4) --> 0.
CAS: type(123.4) --> DOM_FLOAT
CAS: type(123.4)+0. --> 1.

Home: The above all return 0.
Home: TYPE(#123) --> 1
Home: type(#123) --> 1

Home integers are limited in size by the current wordsize setting. The largest possible wordsize setting is 64, so integers greater than 2^64-1 are not possible in Home.

CAS integers, on the other hand, can be huge, up to a maximum of 2^8599-1, and they can be either positive or negative.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: I may have discovered a bug in the input function... - Joe Horn - 09-09-2017 04:01 AM



User(s) browsing this thread: 1 Guest(s)