Why are some casts from floating point to integral done differently

Don nospam at nospam.com
Mon Mar 15 12:48:27 PDT 2010


Walter Bright wrote:
> Don wrote:
>> I don't know, but it's probably historical. The real->ulong code is 
>> quite recent (about a year old), but the other ones are ancient. They 
>> may even come from the 386 days.
> 
> Eh, go back a lot further!

Actually I suspected it might be from the x87 emulator days.
So, the code is probably older than some of the posters to this newsgroup!

OT: My all-time favourite bit of code that I maintain is a little piece 
of x87 asm which dates from 1981. Back then, Intel didn't even sell the 
x87 directly, you had to buy it by mail-order from a guy in Silicon 
Valley who lived near the Intel fab. It's great to see that code still 
running on a quad-core 64 bit CPU!
The app that was converted to Pascal at some point before the 90's, but 
all of that's gone now. Yet the asm survived (with just AX->EAX->RAX)! 
It was a fine piece of work.





More information about the Digitalmars-d mailing list