realbasic-nug
[Top] [All Lists]

Re: Intel vs. PPC math gotcha

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Intel vs. PPC math gotcha
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Thu, 31 May 2007 10:37:21 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <fed2e2560705301533t6d8f66cdw86e8a3125dcf4128 at mail dot gmail dot com> <15F7B30A-E60E-4AA0-AF1E-F48054C42201 at great-white-software dot com> <5d7ca37e0705301827k7040dabvb66af85f6972cd70 at mail dot gmail dot com> <fed2e2560705310906i5b2ca1f1h2d02bc2603d5a75d at mail dot gmail dot com> <4C41BA69-F26B-4AF0-A004-94C1BE42DC54 at great-white-software dot com> <fed2e2560705310918t346e76ddv457853d8e8fc5583 at mail dot gmail dot com>
On 31-May-07, at 10:18 AM, Dennis Birch wrote:

> On 5/31/07, Norman Palardy <npalardy at great-white-software dot com> wrote:
>>
>> On 31-May-07, at 10:06 AM, Dennis Birch wrote:
>>> But it appears to me that it's a case of RB number constants being
>>> handled differently, which may be within the engineers' control.
>>
>> Since constants don't let us specify their exact type it could be
>> simply how promoting a the single to a double behaves
>>
>> They derive their type from the contents and so you can't say this
>> const is a double, this one a single, this one a Uint64
>
> But you could expect RB to offer consistent behavior between  
> platforms.

I'd expect consistent behavior in lots of places

Try this one
Define a NUMBER constant on a window called constUint64
Set its  value to &h8000000000000000
Note that the const editor will say it's a string but you need to  
change it to number

Put this code in a button or something

   const localConstUint64 = &h8000000000000000
   dim i as Uint64 = &h8000000000000001

   if i > constUint64 then
     msgbox "module const ok"
   else
     msgbox "module const bug"
   end if

   if i > LocalConstUint64 then
     msgbox "local const ok"
   else
     msgbox "local const bug"
   end if

Both comparisons should result in i being larger than the const but  
try it :)

<http://www.realsoftware.com/feedback/viewreport.php?reportid=zeagcgso>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>