| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Blaise de Pascal |
Hi, Bob. BL> FM> I guess they were writing it in an earlier BASIC. I think I saw BL> FM> something to the effect that you tried it in GWBASIC and that BL> FM> was indeed the format of their reals. BL> Yair... I'm still very confused, but that's a normal learning state BL>for me. Join the club! BL> BL> $007FFFFF, $00800000, and $ff. WTF does this mean? Are they hex BL> BL> numbers BL> FM> Yes they are hex numbers, and if you have a non-Turbo Pascal BL> FM> reference they may not be mentioned. BL> Bloody books. Paul pointed me at the C code, and I see they are hex. BL>I guessed it anyway, but poor VB doesn't have sfr and shl functions. Doesn't really matter. ALongint shr 24 translates easily to ALongint / 16,777,216. (And before anyone bites me on the bum, we're in BASIC here so '/' will be integer division.) BL> BL> Invalue shr 24 worries me too. That's a hell of a shift right. BL> FM> It's sucking out the exponent, the left-most byte of a 4-byte BL> FM> number. BL> I know bugger-all about binary arithmetic. Me education is lacking. Draw it, little squares representing 8-bit bytes or 4-bit nibbles. I find it helps. BL> FM> then the number is (-1)^S * M * 2^(E-128) and that's what that BL> FM> code below calculates. BL> I saved all that, and will make sense of it later. Thanks, Frank. Then I made it too hard. That was supposed to elicit a flash "AHA!" BL> FM> I think you've now been pointed to the bit of C which BL> FM> implements this. BL> Not that it helps much. Bloody C! The code is brilliantly simple, BL>but like all brilliantly simple C code, it is unreadable. It's fun BL>being a beginner. You learn lots of stuff, and get horribly confused. But you've got a good enough background in circuit-based logic to figure it out. AND, OR, NOT, etc are gates; SHL & SHR are shift registers. Regards, FIM. * * Nothing is ever constant, unless it is dead. @EOT: ---* Origin: Pedants Inc. (3:711/934.24) SEEN-BY: 711/934 @PATH: 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.