Are there integer numbers in the basic of x16 please?

All aspects of programming on the Commander X16.
BruceRMcF
Posts: 222
Joined: Sat Jan 07, 2023 10:33 pm

Re: Are there integer numbers in the basic of x16 please?

Post by BruceRMcF »

skaratso wrote: Mon Mar 25, 2024 4:40 pm ... It's not technically "modified," as it predates the IEEE standard by at least 4 years (it looks like the IEEE 754 standard was first published in a proposal dated 1981 and then ratified in 1985), and Microsoft is responsible for the 5 byte floating point representation since the same format is used in both Commodore BASIC and Applesoft BASIC. ...
Quite. According to one account, some higher up at Commodore asked Microsoft to make the Basic able to handle their salary. Adding the bits to the Microsoft Basic floating point mantissa gave enough range to do that.
DragWx
Posts: 302
Joined: Tue Mar 07, 2023 9:07 pm

Re: Are there integer numbers in the basic of x16 please?

Post by DragWx »

Fun fact: IEEE-754 floats have their bits arranged such that you can use a plain integer sorting algorithm to sort a list of floats, and everything will sort correctly.

Too bad the sign bit is in the wrong place on CBM floats. :P
Slevin
Posts: 29
Joined: Wed Mar 06, 2024 8:04 pm

Re: Are there integer numbers in the basic of x16 please?

Post by Slevin »

TomXP411 wrote: Mon Mar 25, 2024 4:38 pm CBM has the exponent first, followed by the sign and mantissa.
CBM Float Exponent S Mantissa 0111 1111 0 0000 0000 0000 0000 0000 0000 0000 000 IEEE-754 Float S Exponent Mantissa 1 0111 1111 0000 0000 0000 0000 0000 000

Some examples:
2.0 = 1.0 * 2
3.0 = 1.5 * 2
5.0 = 1.25 * 4
2024 = 1.9765625 * 1024
Many thanks for this detailed explanation, helped a lot, especially the placement of the sign bit.
mortarm
Posts: 225
Joined: Tue May 16, 2023 6:21 pm

Re: Are there integer numbers in the basic of x16 please?

Post by mortarm »

BruceRMcF wrote: Mon Mar 25, 2024 5:37 pm Quite. According to one account, some higher up at Commodore asked Microsoft to make the Basic able to handle their salary. Adding the bits to the Microsoft Basic floating point mantissa gave enough range to do that.
Somehow, I rather doubt that they'd rely on BASIC to do their payroll.
hstubbs3
Posts: 72
Joined: Thu Oct 26, 2023 12:14 pm

Re: Are there integer numbers in the basic of x16 please?

Post by hstubbs3 »

mortarm wrote: Wed Mar 27, 2024 3:25 pm
BruceRMcF wrote: Mon Mar 25, 2024 5:37 pm Quite. According to one account, some higher up at Commodore asked Microsoft to make the Basic able to handle their salary. Adding the bits to the Microsoft Basic floating point mantissa gave enough range to do that.
Somehow, I rather doubt that they'd rely on BASIC to do their payroll.
I totally could believe some higher-up wanted to show off that it can display their salary.
Totally something that maybe was used like 5 times for a demo or something, max... and never bothered with again...

It does sound like a tall tale of the ancient days of yore, but there are stranger tales ...
https://www.catb.org/jargon/html/S/scratch-monkey.html
BruceRMcF
Posts: 222
Joined: Sat Jan 07, 2023 10:33 pm

Re: Are there integer numbers in the basic of x16 please?

Post by BruceRMcF »

mortarm wrote: Wed Mar 27, 2024 3:25 pm
BruceRMcF wrote: Mon Mar 25, 2024 5:37 pm Quite. According to one account, some higher up at Commodore asked Microsoft to make the Basic able to handle their salary. Adding the bits to the Microsoft Basic floating point mantissa gave enough range to do that.
Somehow, I rather doubt that they'd rely on BASIC to do their payroll.
As I understood it, that's not the point being made. A single floating point format is the "universal number" for that generation of Microsoft Basic, the idea was that if it couldn't express his salary, it probably wasn't universal enough.

It was from some presentation I saw a video of on Youtube, IIRC the person passing it along had worked at Commodore but wouldn't have been in the room at that kind of meeting, so it could well be apocryphal.

As it was the story circulating inside at least some circles in Commodore, at the very least it must have sounded plausible to them.
Edmond D
Posts: 453
Joined: Thu Aug 19, 2021 1:42 am

Re: Are there integer numbers in the basic of x16 please?

Post by Edmond D »

BruceRMcF wrote: Thu Mar 28, 2024 6:46 pm
mortarm wrote: Wed Mar 27, 2024 3:25 pm
BruceRMcF wrote: Mon Mar 25, 2024 5:37 pm Quite. According to one account, some higher up at Commodore asked Microsoft to make the Basic able to handle their salary. Adding the bits to the Microsoft Basic floating point mantissa gave enough range to do that.
Somehow, I rather doubt that they'd rely on BASIC to do their payroll.
As I understood it, that's not the point being made. A single floating point format is the "universal number" for that generation of Microsoft Basic, the idea was that if it couldn't express his salary, it probably wasn't universal enough.

It was from some presentation I saw a video of on Youtube, IIRC the person passing it along had worked at Commodore but wouldn't have been in the room at that kind of meeting, so it could well be apocryphal.

As it was the story circulating inside at least some circles in Commodore, at the very least it must have sounded plausible to them.
Having tried to understand COBOL, I could see BASIC being plausible for simple payroll calculations.
funkheld
Posts: 259
Joined: Mon Feb 26, 2024 11:11 am

Re: Are there integer numbers in the basic of x16 please?

Post by funkheld »

comal 80 for the x16 would be great.
on the c64 there is the wonderful cobol80.
The x16 has great properties from the c64.

greeting
Edmond D
Posts: 453
Joined: Thu Aug 19, 2021 1:42 am

Re: Are there integer numbers in the basic of x16 please?

Post by Edmond D »

funkheld wrote: Thu Mar 28, 2024 9:16 pm comal 80 for the x16 would be great.
on the c64 there is the wonderful cobol80.
The x16 has great properties from the c64.

greeting
No, thank you. :D
User avatar
ahenry3068
Posts: 969
Joined: Tue Apr 04, 2023 9:57 pm

Re: Are there integer numbers in the basic of x16 please?

Post by ahenry3068 »

Edmond D wrote: Thu Mar 28, 2024 11:14 pm
funkheld wrote: Thu Mar 28, 2024 9:16 pm comal 80 for the x16 would be great.
on the c64 there is the wonderful cobol80.
The x16 has great properties from the c64.

greeting
No, thank you. :D
I will have to say I find it pretty remarkable that there is such a thing as COBOL on the C64, in any form at all. I do 2nd Edmond's no thank you though... I think I might do "Hello World" just for S's & G's but I don't think I would go further than that.
Post Reply