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: Wed, 30 May 2007 16:54:16 -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>
On 30-May-07, at 4:33 PM, Dennis Birch wrote:

> I just got stung by a gotcha that I thought I'd share for the sake of
> the community.
>
> I've been working on a project on my Intel iMac. One bit of code
> compares a file version number constant (kFileVersion) with a version
> number stored in a data file's database table.
>
> The code looks like this:
>
>     dim vers As Single = rs.Field("fi_Version").DoubleValue
>     if vers < kFileVersion Then
>       // update the data file -- omitted
>     end if
>
> This works fine on my Intel Mac. On PPC machines, the "vers <
> kFileVersion" comparison was failing, even when the numbers appeared
> to be identical in the debugger. Changing the declaration of vers to a
> Double fixed the problem.
>
> Hope this helps somebody from pulling out some hair.

Sounds like it's worth a bug report either way
_______________________________________________
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>