Page 1 sur 1

Numeral system

Publié : jeu. sept. 05, 2019 2:37 am
par compsystems
Hi BP,

can Xcas operate number bases ? And if so, what is the format?.
Bases most used
(2 Binary numeral system, 8 Octal system, 10 Decimal system, 16 Hexadecimal system)

Re: Numeral system

Publié : jeu. sept. 05, 2019 7:54 am
par parisse
You can input integers using the standard notations for base 2 (0b...), 16 (0x...), 8 (enter a leading 0 non significant digit). You can print integers in hexa or octal (select the right option in CAS configuration)

Re: Numeral system

Publié : jeu. sept. 05, 2019 8:51 pm
par compsystems
In the configuration of XCAS (PC installer), button [integer Basis], I do not see the option to display in binary, It is very important especially for professionals in computer science and electronics

What is the programming command (flag) to change the base display mode?

Re: Numeral system

Publié : sam. sept. 07, 2019 6:50 am
par parisse
There is no flag, display is purely UI. You can run convert(the_integer,base,2) to get the list of bits of an integer (reverse order).

Re: Numeral system

Publié : jeu. oct. 10, 2019 2:32 am
par compsystems
Hello BP, in the future you can include in the configuration: Integer base: 2. to be able to operate in the worksheet in binary base.